File: OtlpCliJsonSerializerContext.TelemetryApiResponse.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.TelemetryApiResponse>? _TelemetryApiResponse;
        
        /// <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.TelemetryApiResponse> TelemetryApiResponse
        #nullable enable annotations
        {
            get => _TelemetryApiResponse ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Otlp.TelemetryApiResponse>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Otlp.TelemetryApiResponse> Create_TelemetryApiResponse(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Otlp.TelemetryApiResponse>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Otlp.TelemetryApiResponse> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Otlp.TelemetryApiResponse>
                {
                    ObjectCreator = () => new global::Aspire.Cli.Otlp.TelemetryApiResponse(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => TelemetryApiResponsePropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = TelemetryApiResponseSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Otlp.TelemetryApiResponse>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] TelemetryApiResponsePropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[3];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Aspire.Cli.Otlp.TelemetryDataJson>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.TelemetryApiResponse)obj).Data,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.TelemetryApiResponse)obj).Data = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Data",
                JsonPropertyName = "data",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse).GetProperty("Data", InstanceMemberBindingFlags, null, typeof(global::Aspire.Cli.Otlp.TelemetryDataJson), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Aspire.Cli.Otlp.TelemetryDataJson>(options, info0);
 
            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.TelemetryApiResponse)obj).TotalCount,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.TelemetryApiResponse)obj).TotalCount = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "TotalCount",
                JsonPropertyName = "totalCount",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse).GetProperty("TotalCount", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int>(options, info1);
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Otlp.TelemetryApiResponse)obj).ReturnedCount,
                Setter = static (obj, value) => ((global::Aspire.Cli.Otlp.TelemetryApiResponse)obj).ReturnedCount = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ReturnedCount",
                JsonPropertyName = "returnedCount",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Otlp.TelemetryApiResponse).GetProperty("ReturnedCount", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int>(options, info2);
 
            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 TelemetryApiResponseSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Otlp.TelemetryApiResponse? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            global::Aspire.Cli.Otlp.TelemetryDataJson __value_Data = ((global::Aspire.Cli.Otlp.TelemetryApiResponse)value).Data;
            if (__value_Data is not null)
            {
                writer.WritePropertyName(PropName_data);
                TelemetryDataJsonSerializeHandler(writer, __value_Data);
            }
            writer.WriteNumber(PropName_totalCount, ((global::Aspire.Cli.Otlp.TelemetryApiResponse)value).TotalCount);
            writer.WriteNumber(PropName_returnedCount, ((global::Aspire.Cli.Otlp.TelemetryApiResponse)value).ReturnedCount);
 
            writer.WriteEndObject();
        }
    }
}