|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Aspire.Cli.NuGetHelper.Commands
{
internal sealed partial class SearchJsonContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGetHelper.Commands.SearchResult>? _SearchResult;
/// <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::Aspire.Cli.NuGetHelper.Commands.SearchResult> SearchResult
#nullable enable annotations
{
get => _SearchResult ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGetHelper.Commands.SearchResult>)Options.GetTypeInfo(typeof(global::Aspire.Cli.NuGetHelper.Commands.SearchResult));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGetHelper.Commands.SearchResult> Create_SearchResult(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.NuGetHelper.Commands.SearchResult>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGetHelper.Commands.SearchResult> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.NuGetHelper.Commands.SearchResult>
{
ObjectCreator = () => new global::Aspire.Cli.NuGetHelper.Commands.SearchResult(),
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => SearchResultPropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.SearchResult).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
SerializeHandler = SearchResultSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.NuGetHelper.Commands.SearchResult>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SearchResultPropInit(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<global::System.Collections.Generic.List<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.SearchResult),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.SearchResult)obj).Packages,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.SearchResult)obj).Packages = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Packages",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.SearchResult).GetProperty("Packages", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo>>(options, info0);
properties[0].IsGetNullable = false;
properties[0].IsSetNullable = false;
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.SearchResult),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.SearchResult)obj).TotalHits,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.SearchResult)obj).TotalHits = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "TotalHits",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.SearchResult).GetProperty("TotalHits", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int>(options, info1);
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 SearchResultSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.NuGetHelper.Commands.SearchResult? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
global::System.Collections.Generic.List<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo> __value_Packages = ((global::Aspire.Cli.NuGetHelper.Commands.SearchResult)value).Packages;
if (__value_Packages is not null)
{
writer.WritePropertyName(PropName_packages);
ListPackageInfoSerializeHandler(writer, __value_Packages);
}
writer.WriteNumber(PropName_totalHits, ((global::Aspire.Cli.NuGetHelper.Commands.SearchResult)value).TotalHits);
writer.WriteEndObject();
}
}
}
|