|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Aspire.Dashboard.Model.GenAI
{
public sealed partial class GenAIEventsContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.ToolCall>? _ToolCall;
/// <summary>
/// Defines the source generated JSON serialization contract metadata for a given type.
/// </summary>
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.ToolCall> ToolCall
{
get => _ToolCall ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.ToolCall>)Options.GetTypeInfo(typeof(global::Aspire.Dashboard.Model.GenAI.ToolCall));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.ToolCall> Create_ToolCall(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Dashboard.Model.GenAI.ToolCall>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.ToolCall> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Dashboard.Model.GenAI.ToolCall>
{
ObjectCreator = () => new global::Aspire.Dashboard.Model.GenAI.ToolCall(),
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => ToolCallPropInit(options),
ConstructorParameterMetadataInitializer = null,
SerializeHandler = ToolCallSerializeHandler
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Dashboard.Model.GenAI.ToolCall>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ToolCallPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[3];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.ToolCall),
Converter = null,
Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.ToolCall)obj).Id,
Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.ToolCall)obj).Id = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Id",
JsonPropertyName = null
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info0);
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.ToolCall),
Converter = null,
Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.ToolCall)obj).Type,
Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.ToolCall)obj).Type = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Type",
JsonPropertyName = null
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info1);
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Aspire.Dashboard.Model.GenAI.ToolCallFunction>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.ToolCall),
Converter = null,
Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.ToolCall)obj).Function,
Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.ToolCall)obj).Function = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Function",
JsonPropertyName = null
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Aspire.Dashboard.Model.GenAI.ToolCallFunction>(options, info2);
return properties;
}
// Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
// methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
private void ToolCallSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Dashboard.Model.GenAI.ToolCall? value)
{
if (value == null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
string __value_Id = ((global::Aspire.Dashboard.Model.GenAI.ToolCall)value).Id;
if (__value_Id != null)
{
writer.WriteString(PropName_id, __value_Id);
}
string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.ToolCall)value).Type;
if (__value_Type != null)
{
writer.WriteString(PropName_type, __value_Type);
}
global::Aspire.Dashboard.Model.GenAI.ToolCallFunction __value_Function = ((global::Aspire.Dashboard.Model.GenAI.ToolCall)value).Function;
if (__value_Function != null)
{
writer.WritePropertyName(PropName_function);
ToolCallFunctionSerializeHandler(writer, __value_Function);
}
writer.WriteEndObject();
}
}
}
|