|
// <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 GenAIMessagesContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart>? _TextPart;
/// <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.TextPart> TextPart
{
get => _TextPart ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart>)Options.GetTypeInfo(typeof(global::Aspire.Dashboard.Model.GenAI.TextPart));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart> Create_TextPart(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Dashboard.Model.GenAI.TextPart>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Model.GenAI.TextPart> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Dashboard.Model.GenAI.TextPart>
{
ObjectCreator = () => new global::Aspire.Dashboard.Model.GenAI.TextPart(),
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => TextPartPropInit(options),
ConstructorParameterMetadataInitializer = null,
SerializeHandler = TextPartSerializeHandler
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Dashboard.Model.GenAI.TextPart>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] TextPartPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Dashboard.Model.GenAI.TextPart),
Converter = null,
Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.TextPart)obj).Content,
Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.TextPart)obj).Content = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Content",
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.MessagePart),
Converter = null,
Getter = static obj => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)obj).Type,
Setter = static (obj, value) => ((global::Aspire.Dashboard.Model.GenAI.MessagePart)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);
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 TextPartSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Dashboard.Model.GenAI.TextPart? value)
{
if (value == null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
string __value_Content = ((global::Aspire.Dashboard.Model.GenAI.TextPart)value).Content;
if (__value_Content != null)
{
writer.WriteString(PropName_content, __value_Content);
}
string __value_Type = ((global::Aspire.Dashboard.Model.GenAI.MessagePart)value).Type;
if (__value_Type != null)
{
writer.WriteString(PropName_type, __value_Type);
}
writer.WriteEndObject();
}
}
}
|