Table of Contents

Class TuningOperation

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

A long-running operation.

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

Properties

Done

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

[JsonPropertyName("done")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Done { get; set; }

Property Value

bool?

Error

The error result of the operation in case of failure or cancellation.

[JsonPropertyName("error")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, object>? Error { get; set; }

Property Value

Dictionary<string, object>

Metadata

Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.

[JsonPropertyName("metadata")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, object>? Metadata { get; set; }

Property Value

Dictionary<string, object>

Name

The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.

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

Property Value

string

SdkHttpResponse

Used to retain the full HTTP response.

[JsonPropertyName("sdkHttpResponse")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpResponse? SdkHttpResponse { get; set; }

Property Value

HttpResponse

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a TuningOperation object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

TuningOperation

The deserialized TuningOperation object, or null if deserialization fails.