File: BackchannelJsonSerializerContext.CommonErrorData.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::StreamJsonRpc.Protocol.CommonErrorData>? _CommonErrorData;
        
        /// <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::StreamJsonRpc.Protocol.CommonErrorData> CommonErrorData
        #nullable enable annotations
        {
            get => _CommonErrorData ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::StreamJsonRpc.Protocol.CommonErrorData>)Options.GetTypeInfo(typeof(global::StreamJsonRpc.Protocol.CommonErrorData));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::StreamJsonRpc.Protocol.CommonErrorData> Create_CommonErrorData(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::StreamJsonRpc.Protocol.CommonErrorData>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::StreamJsonRpc.Protocol.CommonErrorData> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::StreamJsonRpc.Protocol.CommonErrorData>
                {
                    ObjectCreator = () => new global::StreamJsonRpc.Protocol.CommonErrorData(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => CommonErrorDataPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::StreamJsonRpc.Protocol.CommonErrorData).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = CommonErrorDataSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::StreamJsonRpc.Protocol.CommonErrorData>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] CommonErrorDataPropInit(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::StreamJsonRpc.Protocol.CommonErrorData),
                Converter = null,
                Getter = static obj => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).TypeName,
                Setter = static (obj, value) => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).TypeName = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "TypeName",
                JsonPropertyName = "type",
                AttributeProviderFactory = static () => typeof(global::StreamJsonRpc.Protocol.CommonErrorData).GetProperty("TypeName", 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);
 
            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::StreamJsonRpc.Protocol.CommonErrorData),
                Converter = null,
                Getter = static obj => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).Message,
                Setter = static (obj, value) => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).Message = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Message",
                JsonPropertyName = "message",
                AttributeProviderFactory = static () => typeof(global::StreamJsonRpc.Protocol.CommonErrorData).GetProperty("Message", 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].Order = 1;
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::StreamJsonRpc.Protocol.CommonErrorData),
                Converter = null,
                Getter = static obj => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).StackTrace,
                Setter = static (obj, value) => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).StackTrace = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "StackTrace",
                JsonPropertyName = "stack",
                AttributeProviderFactory = static () => typeof(global::StreamJsonRpc.Protocol.CommonErrorData).GetProperty("StackTrace", 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);
            properties[2].Order = 2;
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::StreamJsonRpc.Protocol.CommonErrorData),
                Converter = null,
                Getter = static obj => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).HResult,
                Setter = static (obj, value) => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).HResult = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "HResult",
                JsonPropertyName = "code",
                AttributeProviderFactory = static () => typeof(global::StreamJsonRpc.Protocol.CommonErrorData).GetProperty("HResult", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int>(options, info3);
            properties[3].Order = 3;
 
            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::StreamJsonRpc.Protocol.CommonErrorData>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::StreamJsonRpc.Protocol.CommonErrorData),
                Converter = null,
                Getter = static obj => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).Inner,
                Setter = static (obj, value) => ((global::StreamJsonRpc.Protocol.CommonErrorData)obj).Inner = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Inner",
                JsonPropertyName = "inner",
                AttributeProviderFactory = static () => typeof(global::StreamJsonRpc.Protocol.CommonErrorData).GetProperty("Inner", InstanceMemberBindingFlags, null, typeof(global::StreamJsonRpc.Protocol.CommonErrorData), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::StreamJsonRpc.Protocol.CommonErrorData>(options, info4);
            properties[4].Order = 4;
 
            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 CommonErrorDataSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::StreamJsonRpc.Protocol.CommonErrorData? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WriteString(PropName_type, ((global::StreamJsonRpc.Protocol.CommonErrorData)value).TypeName);
            writer.WriteString(PropName_message, ((global::StreamJsonRpc.Protocol.CommonErrorData)value).Message);
            writer.WriteString(PropName_stack, ((global::StreamJsonRpc.Protocol.CommonErrorData)value).StackTrace);
            writer.WriteNumber(PropName_code, ((global::StreamJsonRpc.Protocol.CommonErrorData)value).HResult);
            writer.WritePropertyName(PropName_inner);
            CommonErrorDataSerializeHandler(writer, ((global::StreamJsonRpc.Protocol.CommonErrorData)value).Inner);
 
            writer.WriteEndObject();
        }
    }
}