// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Microsoft.Extensions.AI.Evaluation.Reporting.JsonSerialization
{
internal static partial class AzureStorageJsonUtilities
{
private sealed partial class JsonContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext>? _EvaluationContext;
/// <summary>
/// Defines the source generated JSON serialization contract metadata for a given type.
/// </summary>
#nullable disable annotations // Marking the property type as nullable-oblivious.
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext> EvaluationContext
#nullable enable annotations
{
get => _EvaluationContext ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.Evaluation.EvaluationContext));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext> Create_EvaluationContext(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => EvaluationContextPropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = null,
SerializeHandler = EvaluationContextSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.Evaluation.EvaluationContext>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] EvaluationContextPropInit(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::Microsoft.Extensions.AI.Evaluation.EvaluationContext),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.EvaluationContext)obj).Name,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.EvaluationContext)obj).Name = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Name",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.EvaluationContext).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info0);
properties[0].IsGetNullable = false;
properties[0].IsSetNullable = false;
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.EvaluationContext),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.EvaluationContext)obj).Contents,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.EvaluationContext)obj).Contents = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Contents",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.EvaluationContext).GetProperty("Contents", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>>(options, info1);
properties[1].IsGetNullable = false;
properties[1].IsSetNullable = false;
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 EvaluationContextSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.Evaluation.EvaluationContext? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
string __value_Name = ((global::Microsoft.Extensions.AI.Evaluation.EvaluationContext)value).Name;
if (__value_Name is not null)
{
writer.WriteString(PropName_name, __value_Name);
}
global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent> __value_Contents = ((global::Microsoft.Extensions.AI.Evaluation.EvaluationContext)value).Contents;
if (__value_Contents is not null)
{
writer.WritePropertyName(PropName_contents);
IListAIContentSerializeHandler(writer, __value_Contents);
}
writer.WriteEndObject();
}
}
}
}