File: BackchannelJsonSerializerContext.ParameterInfo.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.Backchannel
{
    internal partial class BackchannelJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.ParameterInfo>? _ParameterInfo;
        
        /// <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.Commands.Sdk.ParameterInfo> ParameterInfo
        #nullable enable annotations
        {
            get => _ParameterInfo ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.ParameterInfo>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.ParameterInfo> Create_ParameterInfo(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Commands.Sdk.ParameterInfo>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.ParameterInfo> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Commands.Sdk.ParameterInfo>
                {
                    ObjectCreator = () => new global::Aspire.Cli.Commands.Sdk.ParameterInfo(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => ParameterInfoPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = ParameterInfoSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Commands.Sdk.ParameterInfo>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ParameterInfoPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[8];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).Name,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).Name = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Name",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("Name", 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<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).Type,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).Type = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Type",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("Type", InstanceMemberBindingFlags, null, typeof(global::Aspire.Cli.Commands.Sdk.TypeRefInfo), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>(options, info1);
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).IsOptional,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).IsOptional = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsOptional",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("IsOptional", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info2);
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).IsNullable,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).IsNullable = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsNullable",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("IsNullable", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info3);
 
            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).IsCallback,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).IsCallback = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsCallback",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("IsCallback", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info4);
 
            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.CallbackParameterInfo>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).CallbackParameters,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).CallbackParameters = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "CallbackParameters",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("CallbackParameters", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.CallbackParameterInfo>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.CallbackParameterInfo>>(options, info5);
 
            var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).CallbackReturnType,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).CallbackReturnType = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "CallbackReturnType",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("CallbackReturnType", InstanceMemberBindingFlags, null, typeof(global::Aspire.Cli.Commands.Sdk.TypeRefInfo), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>(options, info6);
 
            var info7 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).DefaultValue,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)obj).DefaultValue = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "DefaultValue",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.ParameterInfo).GetProperty("DefaultValue", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[7] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info7);
 
            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 ParameterInfoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Commands.Sdk.ParameterInfo? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WriteString(PropName_Name, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).Name);
            writer.WritePropertyName(PropName_Type);
            TypeRefInfoSerializeHandler(writer, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).Type);
            writer.WriteBoolean(PropName_IsOptional, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).IsOptional);
            writer.WriteBoolean(PropName_IsNullable, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).IsNullable);
            writer.WriteBoolean(PropName_IsCallback, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).IsCallback);
            writer.WritePropertyName(PropName_CallbackParameters);
            ListCallbackParameterInfoSerializeHandler(writer, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).CallbackParameters);
            writer.WritePropertyName(PropName_CallbackReturnType);
            TypeRefInfoSerializeHandler(writer, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).CallbackReturnType);
            writer.WriteString(PropName_DefaultValue, ((global::Aspire.Cli.Commands.Sdk.ParameterInfo)value).DefaultValue);
 
            writer.WriteEndObject();
        }
    }
}