Package dev.dokimos.server.dto.v1
Record Class CreateLlmConnectionRequest
java.lang.Object
java.lang.Record
dev.dokimos.server.dto.v1.CreateLlmConnectionRequest
public record CreateLlmConnectionRequest(@NotBlank String name, @NotBlank String baseUrl, @NotBlank String model, LlmConnectionProtocol protocol, String apiKey, String credentialRef)
extends Record
Request to register an OpenAI-compatible LLM connection. Exactly one of
apiKey (supplied
inline and stored encrypted) or credentialRef (the name of an environment variable holding
the key) must be set. protocol selects the API the endpoint speaks; when omitted it defaults
to the Responses API.-
Constructor Summary
ConstructorsConstructorDescriptionCreateLlmConnectionRequest(@NotBlank String name, @NotBlank String baseUrl, @NotBlank String model, LlmConnectionProtocol protocol, String apiKey, String credentialRef) Creates an instance of aCreateLlmConnectionRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapiKey()Returns the value of theapiKeyrecord component.@NotBlank StringbaseUrl()Returns the value of thebaseUrlrecord component.Returns the value of thecredentialRefrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@jakarta.validation.constraints.AssertTrue(message="exactly one of apiKey or credentialRef must be set") booleanCross-field rule enforcing that exactly one credential source is supplied.@NotBlank Stringmodel()Returns the value of themodelrecord component.@NotBlank Stringname()Returns the value of thenamerecord component.protocol()Returns the value of theprotocolrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CreateLlmConnectionRequest
public CreateLlmConnectionRequest(@NotBlank @NotBlank String name, @NotBlank @NotBlank String baseUrl, @NotBlank @NotBlank String model, LlmConnectionProtocol protocol, String apiKey, String credentialRef) Creates an instance of aCreateLlmConnectionRequestrecord class.- Parameters:
name- the value for thenamerecord componentbaseUrl- the value for thebaseUrlrecord componentmodel- the value for themodelrecord componentprotocol- the value for theprotocolrecord componentapiKey- the value for theapiKeyrecord componentcredentialRef- the value for thecredentialRefrecord component
-
-
Method Details
-
isCredentialSourceValid
@AssertTrue(message="exactly one of apiKey or credentialRef must be set") public @jakarta.validation.constraints.AssertTrue(message="exactly one of apiKey or credentialRef must be set") boolean isCredentialSourceValid()Cross-field rule enforcing that exactly one credential source is supplied. Returningfalsesurfaces a 400 instead of letting the database check constraint produce a 409. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
baseUrl
Returns the value of thebaseUrlrecord component.- Returns:
- the value of the
baseUrlrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
protocol
Returns the value of theprotocolrecord component.- Returns:
- the value of the
protocolrecord component
-
apiKey
Returns the value of theapiKeyrecord component.- Returns:
- the value of the
apiKeyrecord component
-
credentialRef
Returns the value of thecredentialRefrecord component.- Returns:
- the value of the
credentialRefrecord component
-