Class AuthToken

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.AuthToken

public abstract class AuthToken extends JsonSerializable
Config for auth_tokens.create parameters.
  • Constructor Details

    • AuthToken

      public AuthToken()
  • Method Details

    • name

      public abstract Optional<String> name()
      The name of the auth token.
    • expireTime

      public abstract Optional<String> expireTime()
      Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.) If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future.
    • newSessionExpireTime

      public abstract Optional<String> newSessionExpireTime()
      Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected. If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future.
    • uses

      public abstract Optional<Integer> uses()
      Optional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1.
    • builder

      public static AuthToken.Builder builder()
      Instantiates a builder for AuthToken.
    • toBuilder

      public abstract AuthToken.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static AuthToken fromJson(String jsonString)
      Deserializes a JSON string to a AuthToken object.