Table of Contents

Class CreateAuthTokenConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Optional parameters.

public record CreateAuthTokenConfig : IEquatable<CreateAuthTokenConfig>
Inheritance
CreateAuthTokenConfig
Implements
Inherited Members

Properties

ExpireTime

An optional time after which, when using the resulting token, messages in Live API 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.

[JsonPropertyName("expireTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? ExpireTime { get; set; }

Property Value

DateTime?

HttpOptions

Used to override HTTP request options.

[JsonPropertyName("httpOptions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpOptions? HttpOptions { get; set; }

Property Value

HttpOptions

LiveConnectConstraints

Configuration specific to Live API connections created using this token.

[JsonPropertyName("liveConnectConstraints")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public LiveConnectConstraints? LiveConnectConstraints { get; set; }

Property Value

LiveConnectConstraints

LockAdditionalFields

Additional fields to lock in the effective LiveConnectParameters.

[JsonPropertyName("lockAdditionalFields")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? LockAdditionalFields { get; set; }

Property Value

List<string>

NewSessionExpireTime

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.

[JsonPropertyName("newSessionExpireTime")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? NewSessionExpireTime { get; set; }

Property Value

DateTime?

Uses

The number of times the token can be used. If this value is zero then no limit is applied. Default is 1. Resuming a Live API session does not count as a use.

[JsonPropertyName("uses")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Uses { get; set; }

Property Value

int?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a CreateAuthTokenConfig object.

public static CreateAuthTokenConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

CreateAuthTokenConfig

The deserialized CreateAuthTokenConfig object, or null if deserialization fails.