File: BackchannelJsonSerializerContext.PublishingActivityData.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.Backchannel.PublishingActivityData>? _PublishingActivityData;
        
        /// <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.PublishingActivityData> PublishingActivityData
        {
            get => _PublishingActivityData ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Backchannel.PublishingActivityData>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Backchannel.PublishingActivityData));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Backchannel.PublishingActivityData> Create_PublishingActivityData(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Backchannel.PublishingActivityData>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Backchannel.PublishingActivityData> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Backchannel.PublishingActivityData>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Aspire.Cli.Backchannel.PublishingActivityData(){ Id = (string)args[0], StatusText = (string)args[1], CompletionState = (string)args[2], StepId = (string)args[3], CompletionMessage = (string)args[4], Inputs = (global::System.Collections.Generic.IReadOnlyList<global::Aspire.Cli.Backchannel.PublishingPromptInput>)args[5] },
                    PropertyMetadataInitializer = _ => PublishingActivityDataPropInit(options),
                    ConstructorParameterMetadataInitializer = PublishingActivityDataCtorParamInit,
                    SerializeHandler = PublishingActivityDataSerializeHandler
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Backchannel.PublishingActivityData>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PublishingActivityDataPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[9];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).Id,
                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 = "Id",
                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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).StatusText,
                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 = "StatusText",
                JsonPropertyName = null
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info1);
            properties[1].IsRequired = true;
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).CompletionState,
                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 = "CompletionState",
                JsonPropertyName = null
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info2);
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).IsComplete,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsComplete",
                JsonPropertyName = 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.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).IsError,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsError",
                JsonPropertyName = null
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info4);
 
            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).IsWarning,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsWarning",
                JsonPropertyName = null
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info5);
 
            var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).StepId,
                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 = "StepId",
                JsonPropertyName = null
            };
            
            properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info6);
 
            var info7 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).CompletionMessage,
                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 = "CompletionMessage",
                JsonPropertyName = null
            };
            
            properties[7] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info7);
 
            var info8 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IReadOnlyList<global::Aspire.Cli.Backchannel.PublishingPromptInput>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Backchannel.PublishingActivityData),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Backchannel.PublishingActivityData)obj).Inputs,
                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 = "Inputs",
                JsonPropertyName = null
            };
            
            properties[8] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IReadOnlyList<global::Aspire.Cli.Backchannel.PublishingPromptInput>>(options, info8);
 
            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 PublishingActivityDataSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Backchannel.PublishingActivityData? value)
        {
            if (value == null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WriteString(PropName_Id, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).Id);
            writer.WriteString(PropName_StatusText, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).StatusText);
            writer.WriteString(PropName_CompletionState, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).CompletionState);
            writer.WriteBoolean(PropName_IsComplete, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).IsComplete);
            writer.WriteBoolean(PropName_IsError, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).IsError);
            writer.WriteBoolean(PropName_IsWarning, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).IsWarning);
            writer.WriteString(PropName_StepId, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).StepId);
            writer.WriteString(PropName_CompletionMessage, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).CompletionMessage);
            writer.WritePropertyName(PropName_Inputs);
            IReadOnlyListPublishingPromptInputSerializeHandler(writer, ((global::Aspire.Cli.Backchannel.PublishingActivityData)value).Inputs);
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] PublishingActivityDataCtorParamInit()
        {
            var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[6];
 
            parameters[0] = new()
            {
                Name = "Id",
                ParameterType = typeof(string),
                Position = 0,
            };
            
            parameters[1] = new()
            {
                Name = "StatusText",
                ParameterType = typeof(string),
                Position = 1,
            };
            
            parameters[2] = new()
            {
                Name = "CompletionState",
                ParameterType = typeof(string),
                Position = 2,
            };
            
            parameters[3] = new()
            {
                Name = "StepId",
                ParameterType = typeof(string),
                Position = 3,
            };
            
            parameters[4] = new()
            {
                Name = "CompletionMessage",
                ParameterType = typeof(string),
                Position = 4,
            };
            
            parameters[5] = new()
            {
                Name = "Inputs",
                ParameterType = typeof(global::System.Collections.Generic.IReadOnlyList<global::Aspire.Cli.Backchannel.PublishingPromptInput>),
                Position = 5,
            };
            
            return parameters;
        }
    }
}