File: BundleSearchJsonContext.BundlePackageInfo.g.cs
Project: src\src\Aspire.Cli\Aspire.Cli.csproj (aspire)
// <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.NuGet
{
    internal sealed partial class BundleSearchJsonContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGet.BundlePackageInfo>? _BundlePackageInfo;
        
        /// <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.NuGet.BundlePackageInfo> BundlePackageInfo
        #nullable enable annotations
        {
            get => _BundlePackageInfo ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGet.BundlePackageInfo>)Options.GetTypeInfo(typeof(global::Aspire.Cli.NuGet.BundlePackageInfo));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGet.BundlePackageInfo> Create_BundlePackageInfo(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.NuGet.BundlePackageInfo>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.NuGet.BundlePackageInfo> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.NuGet.BundlePackageInfo>
                {
                    ObjectCreator = () => new global::Aspire.Cli.NuGet.BundlePackageInfo(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => BundlePackageInfoPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = BundlePackageInfoSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.NuGet.BundlePackageInfo>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] BundlePackageInfoPropInit(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.NuGet.BundlePackageInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Id,
                Setter = static (obj, value) => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Id = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Id",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).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.NuGet.BundlePackageInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Version,
                Setter = static (obj, value) => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Version = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Version",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).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.NuGet.BundlePackageInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Description,
                Setter = static (obj, value) => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Description = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Description",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).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.NuGet.BundlePackageInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Authors,
                Setter = static (obj, value) => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Authors = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Authors",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).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.NuGet.BundlePackageInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).AllVersions,
                Setter = static (obj, value) => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).AllVersions = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "AllVersions",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).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);
 
            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.NuGet.BundlePackageInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Source,
                Setter = static (obj, value) => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Source = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Source",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).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.NuGet.BundlePackageInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Deprecated,
                Setter = static (obj, value) => ((global::Aspire.Cli.NuGet.BundlePackageInfo)obj).Deprecated = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Deprecated",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.NuGet.BundlePackageInfo).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 BundlePackageInfoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.NuGet.BundlePackageInfo? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WriteString(PropName_id, ((global::Aspire.Cli.NuGet.BundlePackageInfo)value).Id);
            writer.WriteString(PropName_version, ((global::Aspire.Cli.NuGet.BundlePackageInfo)value).Version);
            writer.WriteString(PropName_description, ((global::Aspire.Cli.NuGet.BundlePackageInfo)value).Description);
            writer.WriteString(PropName_authors, ((global::Aspire.Cli.NuGet.BundlePackageInfo)value).Authors);
            writer.WritePropertyName(PropName_allVersions);
            ListStringSerializeHandler(writer, ((global::Aspire.Cli.NuGet.BundlePackageInfo)value).AllVersions);
            writer.WriteString(PropName_source, ((global::Aspire.Cli.NuGet.BundlePackageInfo)value).Source);
            writer.WriteBoolean(PropName_deprecated, ((global::Aspire.Cli.NuGet.BundlePackageInfo)value).Deprecated);
 
            writer.WriteEndObject();
        }
    }
}