Class OAuth2Config

java.lang.Object
com.google.genai.gaos.models.credentials.OAuth2Config
All Implemented Interfaces:
CredentialCreateParams

public class OAuth2Config extends Object implements CredentialCreateParams
OAuth2Config

Configuration for OAuth2 credentials with automatic token refresh.

  • Constructor Details

    • OAuth2Config

      public OAuth2Config(@Nonnull String clientId, @Nonnull String clientSecret, @Nonnull String id, @Nonnull String refreshToken, @Nullable List<String> scopes, @Nonnull String tokenUrl)
    • OAuth2Config

      public OAuth2Config(@Nonnull String clientId, @Nonnull String clientSecret, @Nonnull String id, @Nonnull String refreshToken, @Nonnull String tokenUrl)
  • Method Details

    • clientId

      public Optional<String> clientId()
      Required. OAuth2 client ID.
    • clientSecret

      public Optional<String> clientSecret()
      Required. Input only. OAuth2 client secret.

      Write-only; never returned in responses.

    • id

      public Optional<String> id()
    • refreshToken

      public Optional<String> refreshToken()
      Required. Input only. OAuth2 refresh token.

      Write-only; never returned in responses.

    • scopes

      public Optional<List<String>> scopes()
      Optional. List of OAuth2 scopes.
    • tokenUrl

      public Optional<String> tokenUrl()
      Required. OAuth2 token endpoint URL for refreshing access tokens.
    • type

      public String type()
      Specified by:
      type in interface CredentialCreateParams
    • builder

      public static OAuth2Config.Builder builder()
    • withClientId

      public OAuth2Config withClientId(@Nonnull String clientId)
      Required. OAuth2 client ID.
    • withClientSecret

      public OAuth2Config withClientSecret(@Nonnull String clientSecret)
      Required. Input only. OAuth2 client secret.

      Write-only; never returned in responses.

    • withId

      public OAuth2Config withId(@Nonnull String id)
    • withRefreshToken

      public OAuth2Config withRefreshToken(@Nonnull String refreshToken)
      Required. Input only. OAuth2 refresh token.

      Write-only; never returned in responses.

    • withScopes

      public OAuth2Config withScopes(@Nullable List<String> scopes)
      Optional. List of OAuth2 scopes.
    • withTokenUrl

      public OAuth2Config withTokenUrl(@Nonnull String tokenUrl)
      Required. OAuth2 token endpoint URL for refreshing access tokens.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object