|
// <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.PackageInfo>? _PackageInfo;
/// <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.PackageInfo> PackageInfo
#nullable enable annotations
{
get => _PackageInfo ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo>)Options.GetTypeInfo(typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo> Create_PackageInfo(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo>
{
ObjectCreator = () => new global::Aspire.Cli.NuGetHelper.Commands.PackageInfo(),
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => PackageInfoPropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
SerializeHandler = PackageInfoSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.NuGetHelper.Commands.PackageInfo>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PackageInfoPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[7];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Id,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Id = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Id",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).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;
properties[0].IsSetNullable = false;
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Version,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Version = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Version",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).GetProperty("Version", 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;
properties[1].IsSetNullable = false;
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Description,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Description = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Description",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).GetProperty("Description", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info2);
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Authors,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Authors = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Authors",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).GetProperty("Authors", 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<global::System.Collections.Generic.List<string>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).AllVersions,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).AllVersions = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "AllVersions",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).GetProperty("AllVersions", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<string>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<string>>(options, info4);
properties[4].IsGetNullable = false;
properties[4].IsSetNullable = false;
var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Source,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Source = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Source",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).GetProperty("Source", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info5);
var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Deprecated,
Setter = static (obj, value) => ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)obj).Deprecated = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Deprecated",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGetHelper.Commands.PackageInfo).GetProperty("Deprecated", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
};
properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info6);
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 PackageInfoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.NuGetHelper.Commands.PackageInfo? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
string __value_Id = ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)value).Id;
if (__value_Id is not null)
{
writer.WriteString(PropName_id, __value_Id);
}
string __value_Version = ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)value).Version;
if (__value_Version is not null)
{
writer.WriteString(PropName_version, __value_Version);
}
string __value_Description = ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)value).Description;
if (__value_Description is not null)
{
writer.WriteString(PropName_description, __value_Description);
}
string __value_Authors = ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)value).Authors;
if (__value_Authors is not null)
{
writer.WriteString(PropName_authors, __value_Authors);
}
global::System.Collections.Generic.List<string> __value_AllVersions = ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)value).AllVersions;
if (__value_AllVersions is not null)
{
writer.WritePropertyName(PropName_allVersions);
ListStringSerializeHandler(writer, __value_AllVersions);
}
string __value_Source = ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)value).Source;
if (__value_Source is not null)
{
writer.WriteString(PropName_source, __value_Source);
}
writer.WriteBoolean(PropName_deprecated, ((global::Aspire.Cli.NuGetHelper.Commands.PackageInfo)value).Deprecated);
writer.WriteEndObject();
}
}
}
|