File: _generated\45\ImportMapSerializerContext.ImportMap.g.cs
Web Access
Project: src\src\sdk\src\StaticWebAssetsSdk\Tasks\Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj (Microsoft.NET.Sdk.StaticWebAssets.Tasks)
// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

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

namespace Microsoft.AspNetCore.StaticWebAssets.Tasks
{
    internal sealed partial class ImportMapSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap>? _ImportMap;
        
        /// <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.AspNetCore.StaticWebAssets.Tasks.ImportMap> ImportMap
        #nullable enable annotations
        {
            get => _ImportMap ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap> Create_ImportMap(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap((global::System.Collections.Generic.Dictionary<string, string>)args[0], (global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.Dictionary<string, string>>)args[1], (global::System.Collections.Generic.Dictionary<string, string>)args[2]),
                    PropertyMetadataInitializer = _ => ImportMapPropInit(options),
                    ConstructorParameterMetadataInitializer = ImportMapCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::System.Collections.Generic.Dictionary<string, string>), typeof(global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.Dictionary<string, string>>), typeof(global::System.Collections.Generic.Dictionary<string, string>)}, modifiers: null),
                    SerializeHandler = ImportMapSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ImportMapPropInit(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::System.Collections.Generic.Dictionary<string, string>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)obj).Imports,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)obj).Imports = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Imports",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap).GetProperty("Imports", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.Dictionary<string, string>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.Dictionary<string, string>>(options, info0);
            properties[0].IsGetNullable = false;
            properties[0].IsSetNullable = false;

            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.Dictionary<string, string>>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)obj).Scopes,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)obj).Scopes = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Scopes",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap).GetProperty("Scopes", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.Dictionary<string, string>>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.Dictionary<string, string>>>(options, info1);
            properties[1].IsGetNullable = false;
            properties[1].IsSetNullable = false;

            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.Dictionary<string, string>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)obj).Integrity,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)obj).Integrity = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Integrity",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap).GetProperty("Integrity", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.Dictionary<string, string>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.Dictionary<string, string>>(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 ImportMapSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WritePropertyName(PropName_Imports);
            DictionaryStringStringSerializeHandler(writer, ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)value).Imports);
            writer.WritePropertyName(PropName_Scopes);
            DictionaryStringDictionaryStringStringSerializeHandler(writer, ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)value).Scopes);
            writer.WritePropertyName(PropName_Integrity);
            DictionaryStringStringSerializeHandler(writer, ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.ImportMap)value).Integrity);

            writer.WriteEndObject();
        }

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

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

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