|
// <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.Packaging.Core.PackageDependency>? _PackageDependency;
/// <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.Packaging.Core.PackageDependency> PackageDependency
#nullable enable annotations
{
get => _PackageDependency ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Packaging.Core.PackageDependency>)Options.GetTypeInfo(typeof(global::NuGet.Packaging.Core.PackageDependency));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Packaging.Core.PackageDependency> Create_PackageDependency(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::NuGet.Packaging.Core.PackageDependency>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Packaging.Core.PackageDependency> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::NuGet.Packaging.Core.PackageDependency>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => PackageDependencyPropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = null,
SerializeHandler = PackageDependencySerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::NuGet.Packaging.Core.PackageDependency>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PackageDependencyPropInit(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::NuGet.Packaging.Core.PackageDependency),
Converter = null,
Getter = static obj => ((global::NuGet.Packaging.Core.PackageDependency)obj).Id,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Id",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Packaging.Core.PackageDependency).GetProperty("Id", 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<global::System.Collections.Generic.IReadOnlyList<string>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Packaging.Core.PackageDependency),
Converter = null,
Getter = static obj => ((global::NuGet.Packaging.Core.PackageDependency)obj).Include,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Include",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Packaging.Core.PackageDependency).GetProperty("Include", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IReadOnlyList<string>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IReadOnlyList<string>>(options, info1);
properties[1].IsGetNullable = false;
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IReadOnlyList<string>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Packaging.Core.PackageDependency),
Converter = null,
Getter = static obj => ((global::NuGet.Packaging.Core.PackageDependency)obj).Exclude,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Exclude",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Packaging.Core.PackageDependency).GetProperty("Exclude", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IReadOnlyList<string>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IReadOnlyList<string>>(options, info2);
properties[2].IsGetNullable = false;
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::NuGet.Versioning.VersionRange>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Packaging.Core.PackageDependency),
Converter = null,
Getter = static obj => ((global::NuGet.Packaging.Core.PackageDependency)obj).VersionRange,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "VersionRange",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.Packaging.Core.PackageDependency).GetProperty("VersionRange", InstanceMemberBindingFlags, null, typeof(global::NuGet.Versioning.VersionRange), global::System.Array.Empty<global::System.Type>(), null),
};
properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::NuGet.Versioning.VersionRange>(options, info3);
properties[3].IsGetNullable = 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 PackageDependencySerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::NuGet.Packaging.Core.PackageDependency? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WriteString(PropName_Id, ((global::NuGet.Packaging.Core.PackageDependency)value).Id);
writer.WritePropertyName(PropName_Include);
IReadOnlyListStringSerializeHandler(writer, ((global::NuGet.Packaging.Core.PackageDependency)value).Include);
writer.WritePropertyName(PropName_Exclude);
IReadOnlyListStringSerializeHandler(writer, ((global::NuGet.Packaging.Core.PackageDependency)value).Exclude);
writer.WritePropertyName(PropName_VersionRange);
VersionRangeSerializeHandler(writer, ((global::NuGet.Packaging.Core.PackageDependency)value).VersionRange);
writer.WriteEndObject();
}
}
}
|