Package com.google.genai.types
Class ApiKeyConfig
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ApiKeyConfig
Config for authentication with API key. This data type is not supported in Gemini API.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional.Optional.static ApiKeyConfig.Builderbuilder()Instantiates a builder for ApiKeyConfig.static ApiKeyConfigDeserializes a JSON string to a ApiKeyConfig object.abstract Optional<HttpElementLocation>Optional.name()Optional.abstract ApiKeyConfig.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
setMaxReadLength, stringToJsonNode, toJson
-
Constructor Details
-
ApiKeyConfig
public ApiKeyConfig()
-
-
Method Details
-
apiKeySecret
Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. -
apiKeyString
Optional. The API key to be used in the request directly. -
httpElementLocation
Optional. The location of the API key. -
name
Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name. -
builder
Instantiates a builder for ApiKeyConfig. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a ApiKeyConfig object.
-