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
readerUtf8JsonReadertypeToConvertTypeoptionsJsonSerializerOptions
Returns
Write(Utf8JsonWriter, BatchJobResponse, JsonSerializerOptions)
Writes the BatchJobResponse object to JSON.
public override void Write(Utf8JsonWriter writer, BatchJobResponse value, JsonSerializerOptions options)
Parameters
writerUtf8JsonWritervalueBatchJobResponseoptionsJsonSerializerOptions