File: _generated\157\TelemetryDiskLoggerJsonSerializerContext.EventModel.g.cs
Web Access
Project: src\src\sdk\src\Cli\dotnet\dotnet.csproj (dotnet)
// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618

namespace Microsoft.DotNet.Cli.Telemetry
{
    internal partial class TelemetryDiskLoggerJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel>? _EventModel;
        
        /// <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::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel> EventModel
        #nullable enable annotations
        {
            get => _EventModel ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel>)Options.GetTypeInfo(typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel> Create_EventModel(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel((string)args[0], (global::System.DateTimeOffset)args[1], (global::System.Collections.Generic.Dictionary<string, object>)args[2]),
                    PropertyMetadataInitializer = _ => EventModelPropInit(options),
                    ConstructorParameterMetadataInitializer = EventModelCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(global::System.DateTimeOffset), typeof(global::System.Collections.Generic.Dictionary<string, object>)}, modifiers: null),
                    SerializeHandler = EventModelSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] EventModelPropInit(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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel),
                Converter = null,
                Getter = static obj => ((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)obj).name,
                Setter = static (obj, value) => __set_EventModel_name((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)obj, value!),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "name",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel).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<global::System.DateTimeOffset>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel),
                Converter = null,
                Getter = static obj => ((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)obj).timestamp,
                Setter = static (obj, value) => __set_EventModel_timestamp((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)obj, value!),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "timestamp",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel).GetProperty("timestamp", InstanceMemberBindingFlags, null, typeof(global::System.DateTimeOffset), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.DateTimeOffset>(options, info1);

            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.Dictionary<string, object>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel),
                Converter = null,
                Getter = static obj => ((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)obj).tags,
                Setter = static (obj, value) => __set_EventModel_tags((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)obj, value!),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "tags",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel).GetProperty("tags", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.Dictionary<string, object>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.Dictionary<string, object>>(options, info2);
            properties[2].IsGetNullable = false;
            properties[2].IsSetNullable = false;

            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 EventModelSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WriteString(PropName_name, ((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)value).name);
            writer.WriteString(PropName_timestamp, ((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)value).timestamp);
            writer.WritePropertyName(PropName_tags);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel)value).tags, DictionaryStringObject);

            writer.WriteEndObject();
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] EventModelCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "name",
                ParameterType = typeof(string),
                Position = 0,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },

            new()
            {
                Name = "timestamp",
                ParameterType = typeof(global::System.DateTimeOffset),
                Position = 1,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },

            new()
            {
                Name = "tags",
                ParameterType = typeof(global::System.Collections.Generic.Dictionary<string, object>),
                Position = 2,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },
        };

        [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_name")]
        private static extern void __set_EventModel_name(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel obj, string value);
        [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_timestamp")]
        private static extern void __set_EventModel_timestamp(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel obj, global::System.DateTimeOffset value);
        [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_tags")]
        private static extern void __set_EventModel_tags(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel obj, global::System.Collections.Generic.Dictionary<string, object> value);
    }
}