File: BackchannelJsonSerializerContext.CommandOutput.g.cs
Project: src\src\Aspire.Cli\Aspire.Cli.Tool.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.Backchannel.CommandOutput>? _CommandOutput;
        
        /// <summary>
        /// Defines the source generated JSON serialization contract metadata for a given type.
        /// </summary>
        public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Backchannel.CommandOutput> CommandOutput
        {
            get => _CommandOutput ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Backchannel.CommandOutput>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Backchannel.CommandOutput));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Backchannel.CommandOutput> Create_CommandOutput(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Backchannel.CommandOutput>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Backchannel.CommandOutput> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Backchannel.CommandOutput>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Aspire.Cli.Backchannel.CommandOutput(){ Text = (string)args[0], IsErrorMessage = (bool)args[1], LineNumber = (int?)args[2], Type = (string)args[3], ExitCode = (int?)args[4] },
                    PropertyMetadataInitializer = _ => CommandOutputPropInit(options),
                    ConstructorParameterMetadataInitializer = CommandOutputCtorParamInit,
                    SerializeHandler = CommandOutputSerializeHandler
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Backchannel.CommandOutput>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] CommandOutputPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.CommandOutput),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.CommandOutput)obj).Text,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Text",
                JsonPropertyName = null
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info0);
            properties[0].IsRequired = true;
 
            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.CommandOutput),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.CommandOutput)obj).IsErrorMessage,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsErrorMessage",
                JsonPropertyName = null
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info1);
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int?>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.CommandOutput),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.CommandOutput)obj).LineNumber,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "LineNumber",
                JsonPropertyName = null
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int?>(options, info2);
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.CommandOutput),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.CommandOutput)obj).Type,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Type",
                JsonPropertyName = null
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info3);
 
            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int?>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.CommandOutput),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.CommandOutput)obj).ExitCode,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ExitCode",
                JsonPropertyName = null
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int?>(options, info4);
 
            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 CommandOutputSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Backchannel.CommandOutput? value)
        {
            if (value == null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WriteString(PropName_Text, ((global::Aspire.Cli.Backchannel.CommandOutput)value).Text);
            writer.WriteBoolean(PropName_IsErrorMessage, ((global::Aspire.Cli.Backchannel.CommandOutput)value).IsErrorMessage);
            writer.WritePropertyName(PropName_LineNumber);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Aspire.Cli.Backchannel.CommandOutput)value).LineNumber, NullableInt32);
            writer.WriteString(PropName_Type, ((global::Aspire.Cli.Backchannel.CommandOutput)value).Type);
            writer.WritePropertyName(PropName_ExitCode);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Aspire.Cli.Backchannel.CommandOutput)value).ExitCode, NullableInt32);
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] CommandOutputCtorParamInit()
        {
            var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[5];
 
            parameters[0] = new()
            {
                Name = "Text",
                ParameterType = typeof(string),
                Position = 0,
            };
            
            parameters[1] = new()
            {
                Name = "IsErrorMessage",
                ParameterType = typeof(bool),
                Position = 1,
            };
            
            parameters[2] = new()
            {
                Name = "LineNumber",
                ParameterType = typeof(int?),
                Position = 2,
            };
            
            parameters[3] = new()
            {
                Name = "Type",
                ParameterType = typeof(string),
                Position = 3,
            };
            
            parameters[4] = new()
            {
                Name = "ExitCode",
                ParameterType = typeof(int?),
                Position = 4,
            };
            
            return parameters;
        }
    }
}