|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace NuGet.CommandLine.XPlat
{
internal partial class PackageSearchJsonContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Versioning.FloatRange>? _FloatRange;
/// <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::NuGet.Versioning.FloatRange> FloatRange
#nullable enable annotations
{
get => _FloatRange ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Versioning.FloatRange>)Options.GetTypeInfo(typeof(global::NuGet.Versioning.FloatRange));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Versioning.FloatRange> Create_FloatRange(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::NuGet.Versioning.FloatRange>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Versioning.FloatRange> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::NuGet.Versioning.FloatRange>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => FloatRangePropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = null,
SerializeHandler = FloatRangeSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::NuGet.Versioning.FloatRange>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] FloatRangePropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Versioning.FloatRange),
Converter = null,
Getter = static obj => ((global::NuGet.Versioning.FloatRange)obj).HasMinVersion,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "HasMinVersion",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.FloatRange).GetProperty("HasMinVersion", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info0);
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::NuGet.Versioning.NuGetVersion>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Versioning.FloatRange),
Converter = null,
Getter = static obj => ((global::NuGet.Versioning.FloatRange)obj).MinVersion,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "MinVersion",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.FloatRange).GetProperty("MinVersion", InstanceMemberBindingFlags, null, typeof(global::NuGet.Versioning.NuGetVersion), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::NuGet.Versioning.NuGetVersion>(options, info1);
properties[1].IsGetNullable = false;
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::NuGet.Versioning.NuGetVersionFloatBehavior>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Versioning.FloatRange),
Converter = null,
Getter = static obj => ((global::NuGet.Versioning.FloatRange)obj).FloatBehavior,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "FloatBehavior",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.FloatRange).GetProperty("FloatBehavior", InstanceMemberBindingFlags, null, typeof(global::NuGet.Versioning.NuGetVersionFloatBehavior), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::NuGet.Versioning.NuGetVersionFloatBehavior>(options, info2);
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Versioning.FloatRange),
Converter = null,
Getter = static obj => ((global::NuGet.Versioning.FloatRange)obj).OriginalReleasePrefix,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "OriginalReleasePrefix",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.FloatRange).GetProperty("OriginalReleasePrefix", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info3);
var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Versioning.FloatRange),
Converter = null,
Getter = static obj => ((global::NuGet.Versioning.FloatRange)obj).IncludePrerelease,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "IncludePrerelease",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.FloatRange).GetProperty("IncludePrerelease", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
};
properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info4);
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 FloatRangeSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::NuGet.Versioning.FloatRange? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WriteBoolean(PropName_HasMinVersion, ((global::NuGet.Versioning.FloatRange)value).HasMinVersion);
writer.WritePropertyName(PropName_MinVersion);
NuGetVersionSerializeHandler(writer, ((global::NuGet.Versioning.FloatRange)value).MinVersion);
writer.WritePropertyName(PropName_FloatBehavior);
global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::NuGet.Versioning.FloatRange)value).FloatBehavior, NuGetVersionFloatBehavior);
writer.WriteString(PropName_OriginalReleasePrefix, ((global::NuGet.Versioning.FloatRange)value).OriginalReleasePrefix);
writer.WriteBoolean(PropName_IncludePrerelease, ((global::NuGet.Versioning.FloatRange)value).IncludePrerelease);
writer.WriteEndObject();
}
}
}
|