// <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 JsonUtilities
{
private sealed partial class JsonContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry>? _CacheEntry;
/// <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.Reporting.Storage.DiskBasedResponseCache.CacheEntry> CacheEntry
#nullable enable annotations
{
get => _CacheEntry ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry> Create_CacheEntry(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry((string)args[0], (string)args[1], (global::System.DateTime)args[2], (global::System.DateTime)args[3]),
PropertyMetadataInitializer = _ => CacheEntryPropInit(options),
ConstructorParameterMetadataInitializer = CacheEntryCtorParamInit,
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(global::System.DateTime), typeof(global::System.DateTime)}, modifiers: null),
SerializeHandler = CacheEntrySerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] CacheEntryPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)obj).ScenarioName,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "ScenarioName",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry).GetProperty("ScenarioName", 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;
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)obj).IterationName,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "IterationName",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry).GetProperty("IterationName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info1);
properties[1].IsGetNullable = false;
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.DateTime>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)obj).Creation,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Creation",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry).GetProperty("Creation", InstanceMemberBindingFlags, null, typeof(global::System.DateTime), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.DateTime>(options, info2);
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.DateTime>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)obj).Expiration,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Expiration",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry).GetProperty("Expiration", InstanceMemberBindingFlags, null, typeof(global::System.DateTime), global::System.Array.Empty<global::System.Type>(), null),
};
properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.DateTime>(options, info3);
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 CacheEntrySerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
string __value_ScenarioName = ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)value).ScenarioName;
if (__value_ScenarioName is not null)
{
writer.WriteString(PropName_scenarioName, __value_ScenarioName);
}
string __value_IterationName = ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)value).IterationName;
if (__value_IterationName is not null)
{
writer.WriteString(PropName_iterationName, __value_IterationName);
}
writer.WriteString(PropName_creation, ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)value).Creation);
writer.WriteString(PropName_expiration, ((global::Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCache.CacheEntry)value).Expiration);
writer.WriteEndObject();
}
private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] CacheEntryCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
{
new()
{
Name = "scenarioName",
ParameterType = typeof(string),
Position = 0,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "iterationName",
ParameterType = typeof(string),
Position = 1,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "creation",
ParameterType = typeof(global::System.DateTime),
Position = 2,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "expiration",
ParameterType = typeof(global::System.DateTime),
Position = 3,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
};
}
}
}