Table of Contents

Class Operation<TOperation>

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

An abstract operation.

public abstract record Operation<TOperation> : IEquatable<Operation<TOperation>>

Type Parameters

TOperation
Inheritance
Operation<TOperation>
Implements
IEquatable<Operation<TOperation>>
Derived
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

Methods

FromApiResponse(JsonNode, bool)

Creates a new Operation object from an API response.

public abstract TOperation FromApiResponse(JsonNode response, bool isVertexAI)

Parameters

response JsonNode
isVertexAI bool

Returns

TOperation