Class ApiKeyConfig
-
- All Implemented Interfaces:
public abstract class ApiKeyConfig extends JsonSerializable
Config for authentication with API key. This data type is not supported in Gemini API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classApiKeyConfig.BuilderBuilder for ApiKeyConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description ApiKeyConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>apiKeySecret()Optional. abstract Optional<String>apiKeyString()Optional. abstract Optional<HttpElementLocation>httpElementLocation()Optional. abstract Optional<String>name()Optional. static ApiKeyConfig.Builderbuilder()Instantiates a builder for ApiKeyConfig. abstract ApiKeyConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static ApiKeyConfigfromJson(String jsonString)Deserializes a JSON string to a ApiKeyConfig object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
apiKeySecret
abstract Optional<String> 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
abstract Optional<String> apiKeyString()
Optional. The API key to be used in the request directly.
-
httpElementLocation
abstract Optional<HttpElementLocation> httpElementLocation()
Optional. The location of the API key.
-
name
abstract Optional<String> 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
static ApiKeyConfig.Builder builder()
Instantiates a builder for ApiKeyConfig.
-
toBuilder
abstract ApiKeyConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static ApiKeyConfig fromJson(String jsonString)
Deserializes a JSON string to a ApiKeyConfig object.
-
-
-
-