Table of Contents

Class ApiAuthApiKeyConfig

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

The API secret. This data type is not supported in Gemini API.

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

Properties

ApiKeySecretVersion

The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}

[JsonPropertyName("apiKeySecretVersion")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ApiKeySecretVersion { get; set; }

Property Value

string

ApiKeyString

The API key string. Either this or api_key_secret_version must be set.

[JsonPropertyName("apiKeyString")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ApiKeyString { get; set; }

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ApiAuthApiKeyConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ApiAuthApiKeyConfig

The deserialized ApiAuthApiKeyConfig object, or null if deserialization fails.