Class AuthConfig
The authentication config to access the API.
public record AuthConfig : IEquatable<AuthConfig>
- Inheritance
-
AuthConfig
- Implements
- Inherited Members
Properties
ApiKey
The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API.
[JsonPropertyName("apiKey")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ApiKey { get; set; }
Property Value
ApiKeyConfig
Config for API key auth.
[JsonPropertyName("apiKeyConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ApiKeyConfig? ApiKeyConfig { get; set; }
Property Value
AuthType
Type of auth scheme.
[JsonPropertyName("authType")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AuthType? AuthType { get; set; }
Property Value
GoogleServiceAccountConfig
Config for Google Service Account auth.
[JsonPropertyName("googleServiceAccountConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AuthConfigGoogleServiceAccountConfig? GoogleServiceAccountConfig { get; set; }
Property Value
HttpBasicAuthConfig
Config for HTTP Basic auth.
[JsonPropertyName("httpBasicAuthConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AuthConfigHttpBasicAuthConfig? HttpBasicAuthConfig { get; set; }
Property Value
OauthConfig
Config for user oauth.
[JsonPropertyName("oauthConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AuthConfigOauthConfig? OauthConfig { get; set; }
Property Value
OidcConfig
Config for user OIDC auth.
[JsonPropertyName("oidcConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AuthConfigOidcConfig? OidcConfig { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a AuthConfig object.
public static AuthConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- AuthConfig
The deserialized AuthConfig object, or null if deserialization fails.