Package com.google.genai.types
Class AuthConfig
-
- All Implemented Interfaces:
public abstract class AuthConfig extends JsonSerializable
The authentication config to access the API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classAuthConfig.BuilderBuilder for AuthConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description AuthConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>apiKey()The authentication config to access the API. abstract Optional<ApiKeyConfig>apiKeyConfig()Config for API key auth. abstract Optional<AuthType>authType()Type of auth scheme. abstract Optional<AuthConfigGoogleServiceAccountConfig>googleServiceAccountConfig()Config for Google Service Account auth. abstract Optional<AuthConfigHttpBasicAuthConfig>httpBasicAuthConfig()Config for HTTP Basic auth. abstract Optional<AuthConfigOauthConfig>oauthConfig()Config for user oauth. abstract Optional<AuthConfigOidcConfig>oidcConfig()Config for user OIDC auth. static AuthConfig.Builderbuilder()Instantiates a builder for AuthConfig. abstract AuthConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static AuthConfigfromJson(String jsonString)Deserializes a JSON string to a AuthConfig 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
-
apiKey
abstract Optional<String> apiKey()
The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API.
-
apiKeyConfig
abstract Optional<ApiKeyConfig> apiKeyConfig()
Config for API key auth.
-
googleServiceAccountConfig
abstract Optional<AuthConfigGoogleServiceAccountConfig> googleServiceAccountConfig()
Config for Google Service Account auth.
-
httpBasicAuthConfig
abstract Optional<AuthConfigHttpBasicAuthConfig> httpBasicAuthConfig()
Config for HTTP Basic auth.
-
oauthConfig
abstract Optional<AuthConfigOauthConfig> oauthConfig()
Config for user oauth.
-
oidcConfig
abstract Optional<AuthConfigOidcConfig> oidcConfig()
Config for user OIDC auth.
-
builder
static AuthConfig.Builder builder()
Instantiates a builder for AuthConfig.
-
toBuilder
abstract AuthConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static AuthConfig fromJson(String jsonString)
Deserializes a JSON string to a AuthConfig object.
-
-
-
-