File: OtlpJsonSerializerContext.OtlpLogsDataJson.g.cs
Project: src\src\Aspire.Dashboard\Aspire.Dashboard.csproj (Aspire.Dashboard)
// <auto-generated/>
 
#nullable enable annotations
#nullable disable warnings
 
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
 
namespace Aspire.Dashboard.Otlp.Model.Serialization
{
    internal sealed partial class OtlpJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson>? _OtlpLogsDataJson;
        
        /// <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.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson> OtlpLogsDataJson
        #nullable enable annotations
        {
            get => _OtlpLogsDataJson ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson>)Options.GetTypeInfo(typeof(global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson> Create_OtlpLogsDataJson(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson>
                {
                    ObjectCreator = () => new global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => OtlpLogsDataJsonPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = OtlpLogsDataJsonSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] OtlpLogsDataJsonPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpResourceLogsJson[]>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson),
                Converter = null,
                Getter = static obj => ((global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson)obj).ResourceLogs,
                Setter = static (obj, value) => ((global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson)obj).ResourceLogs = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ResourceLogs",
                JsonPropertyName = "resourceLogs",
                AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson).GetProperty("ResourceLogs", InstanceMemberBindingFlags, null, typeof(global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpResourceLogsJson[]), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpResourceLogsJson[]>(options, info0);
 
            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 OtlpLogsDataJsonSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpResourceLogsJson[] __value_ResourceLogs = ((global::Aspire.Dashboard.Otlp.Model.Serialization.OtlpLogsDataJson)value).ResourceLogs;
            if (__value_ResourceLogs is not null)
            {
                writer.WritePropertyName(PropName_resourceLogs);
                OtlpResourceLogsJsonArraySerializeHandler(writer, __value_ResourceLogs);
            }
 
            writer.WriteEndObject();
        }
    }
}