Table of Contents

Class BatchJobResponseConverter

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Custom JSON converter for BatchJobResponse that handles dynamic response parsing based on the metadata type field.

public class BatchJobResponseConverter : JsonConverter<BatchJobResponse>
Inheritance
BatchJobResponseConverter
Inherited Members
Extension Methods

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to a BatchJobResponse object. Handles both Google AI format (with "metadata" wrapper) and Vertex AI format (flat structure).

public override BatchJobResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

BatchJobResponse

Write(Utf8JsonWriter, BatchJobResponse, JsonSerializerOptions)

Writes the BatchJobResponse object to JSON.

public override void Write(Utf8JsonWriter writer, BatchJobResponse value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value BatchJobResponse
options JsonSerializerOptions