File: OtlpCliJsonSerializerContext.ResourceInfoJson.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.Otlp
{
    internal sealed partial class OtlpCliJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Otlp.ResourceInfoJson>? _ResourceInfoJson;
        
        /// <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.Otlp.ResourceInfoJson> ResourceInfoJson
        #nullable enable annotations
        {
            get => _ResourceInfoJson ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Otlp.ResourceInfoJson>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Otlp.ResourceInfoJson));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Otlp.ResourceInfoJson> Create_ResourceInfoJson(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Otlp.ResourceInfoJson>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Otlp.ResourceInfoJson> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Otlp.ResourceInfoJson>
                {
                    ObjectCreator = () => new global::Aspire.Cli.Otlp.ResourceInfoJson(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => ResourceInfoJsonPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.ResourceInfoJson).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = ResourceInfoJsonSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Otlp.ResourceInfoJson>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ResourceInfoJsonPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[6];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.ResourceInfoJson),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).Name,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).Name = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Name",
                JsonPropertyName = "name",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.ResourceInfoJson).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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.ResourceInfoJson),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).InstanceId,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).InstanceId = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "InstanceId",
                JsonPropertyName = "instanceId",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.ResourceInfoJson).GetProperty("InstanceId", 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);
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.ResourceInfoJson),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).DisplayName,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).DisplayName = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "DisplayName",
                JsonPropertyName = "displayName",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.ResourceInfoJson).GetProperty("DisplayName", 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].IsGetNullable = false;
            properties[2].IsSetNullable = false;
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.ResourceInfoJson),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).HasLogs,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).HasLogs = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "HasLogs",
                JsonPropertyName = "hasLogs",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.ResourceInfoJson).GetProperty("HasLogs", 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.Otlp.ResourceInfoJson),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).HasTraces,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).HasTraces = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "HasTraces",
                JsonPropertyName = "hasTraces",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.ResourceInfoJson).GetProperty("HasTraces", 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<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.ResourceInfoJson),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).HasMetrics,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.ResourceInfoJson)obj).HasMetrics = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "HasMetrics",
                JsonPropertyName = "hasMetrics",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.ResourceInfoJson).GetProperty("HasMetrics", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info5);
 
            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 ResourceInfoJsonSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Otlp.ResourceInfoJson? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            string __value_Name = ((global::Aspire.Cli.Otlp.ResourceInfoJson)value).Name;
            if (__value_Name is not null)
            {
                writer.WriteString(PropName_name, __value_Name);
            }
            string __value_InstanceId = ((global::Aspire.Cli.Otlp.ResourceInfoJson)value).InstanceId;
            if (__value_InstanceId is not null)
            {
                writer.WriteString(PropName_instanceId, __value_InstanceId);
            }
            string __value_DisplayName = ((global::Aspire.Cli.Otlp.ResourceInfoJson)value).DisplayName;
            if (__value_DisplayName is not null)
            {
                writer.WriteString(PropName_displayName, __value_DisplayName);
            }
            writer.WriteBoolean(PropName_hasLogs, ((global::Aspire.Cli.Otlp.ResourceInfoJson)value).HasLogs);
            writer.WriteBoolean(PropName_hasTraces, ((global::Aspire.Cli.Otlp.ResourceInfoJson)value).HasTraces);
            writer.WriteBoolean(PropName_hasMetrics, ((global::Aspire.Cli.Otlp.ResourceInfoJson)value).HasMetrics);
 
            writer.WriteEndObject();
        }
    }
}