Table of Contents

Class UploadFileConfig

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

Used to override the default configuration.

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

Properties

DisplayName

Optional display name of the file.

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

Property Value

string

HttpOptions

Used to override HTTP request options.

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

Property Value

HttpOptions

MimeType

mime_type: The MIME type of the file. If not provided, it will be inferred from the file extension.

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

Property Value

string

Name

The name of the file in the destination (e.g., 'files/sample-image'. If not provided one will be generated.

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

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a UploadFileConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

UploadFileConfig

The deserialized UploadFileConfig object, or null if deserialization fails.