|
// <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.CommandLine.XPlat.PackageSearchResult>? _PackageSearchResult;
/// <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.CommandLine.XPlat.PackageSearchResult> PackageSearchResult
#nullable enable annotations
{
get => _PackageSearchResult ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.CommandLine.XPlat.PackageSearchResult>)Options.GetTypeInfo(typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.CommandLine.XPlat.PackageSearchResult> Create_PackageSearchResult(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::NuGet.CommandLine.XPlat.PackageSearchResult>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.CommandLine.XPlat.PackageSearchResult> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::NuGet.CommandLine.XPlat.PackageSearchResult>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = static args => new global::NuGet.CommandLine.XPlat.PackageSearchResult((string)args[0]),
PropertyMetadataInitializer = _ => PackageSearchResultPropInit(options),
ConstructorParameterMetadataInitializer = PackageSearchResultCtorParamInit,
ConstructorAttributeProviderFactory = static () => typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
SerializeHandler = PackageSearchResultSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::NuGet.CommandLine.XPlat.PackageSearchResult>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PackageSearchResultPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[3];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult),
Converter = null,
Getter = static obj => ((global::NuGet.CommandLine.XPlat.PackageSearchResult)obj).SourceName,
Setter = static (obj, value) => ((global::NuGet.CommandLine.XPlat.PackageSearchResult)obj).SourceName = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "SourceName",
JsonPropertyName = "sourceName",
AttributeProviderFactory = static () => typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult).GetProperty("SourceName", 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);
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::NuGet.CommandLine.XPlat.PackageSearchProblem>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult),
Converter = null,
Getter = static obj => ((global::NuGet.CommandLine.XPlat.PackageSearchResult)obj).Problems,
Setter = static (obj, value) => ((global::NuGet.CommandLine.XPlat.PackageSearchResult)obj).Problems = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Problems",
JsonPropertyName = "problems",
AttributeProviderFactory = static () => typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult).GetProperty("Problems", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::NuGet.CommandLine.XPlat.PackageSearchProblem>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::NuGet.CommandLine.XPlat.PackageSearchProblem>>(options, info1);
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::NuGet.Protocol.Core.Types.IPackageSearchMetadata>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult),
Converter = null,
Getter = static obj => ((global::NuGet.CommandLine.XPlat.PackageSearchResult)obj).Packages,
Setter = static (obj, value) => ((global::NuGet.CommandLine.XPlat.PackageSearchResult)obj).Packages = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Packages",
JsonPropertyName = "packages",
AttributeProviderFactory = static () => typeof(global::NuGet.CommandLine.XPlat.PackageSearchResult).GetProperty("Packages", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::NuGet.Protocol.Core.Types.IPackageSearchMetadata>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::NuGet.Protocol.Core.Types.IPackageSearchMetadata>>(options, info2);
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 PackageSearchResultSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::NuGet.CommandLine.XPlat.PackageSearchResult? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WriteString(PropName_sourceName, ((global::NuGet.CommandLine.XPlat.PackageSearchResult)value).SourceName);
writer.WritePropertyName(PropName_problems);
ListPackageSearchProblemSerializeHandler(writer, ((global::NuGet.CommandLine.XPlat.PackageSearchResult)value).Problems);
writer.WritePropertyName(PropName_packages);
ListIPackageSearchMetadataSerializeHandler(writer, ((global::NuGet.CommandLine.XPlat.PackageSearchResult)value).Packages);
writer.WriteEndObject();
}
private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] PackageSearchResultCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
{
new()
{
Name = "source",
ParameterType = typeof(string),
Position = 0,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = true,
},
};
}
}
|