File: IdentityJsonSerializerContext.CollectedClientData.g.cs
Project: src\src\Identity\Core\src\Microsoft.AspNetCore.Identity.csproj (Microsoft.AspNetCore.Identity)
// <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.Identity
{
    internal partial class IdentityJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.CollectedClientData>? _CollectedClientData;
        
        /// <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.Identity.CollectedClientData> CollectedClientData
        #nullable enable annotations
        {
            get => _CollectedClientData ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.CollectedClientData>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.CollectedClientData> Create_CollectedClientData(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.Identity.CollectedClientData>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.CollectedClientData> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.Identity.CollectedClientData>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.AspNetCore.Identity.CollectedClientData(){ Type = (string)args[0], Challenge = (global::Microsoft.AspNetCore.Identity.BufferSource)args[1], Origin = (string)args[2], CrossOrigin = (bool?)args[3], TopOrigin = (string)args[4], TokenBinding = (global::Microsoft.AspNetCore.Identity.TokenBinding)args[5] },
                    PropertyMetadataInitializer = _ => CollectedClientDataPropInit(options),
                    ConstructorParameterMetadataInitializer = CollectedClientDataCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = CollectedClientDataSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.AspNetCore.Identity.CollectedClientData>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] CollectedClientDataPropInit(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::Microsoft.AspNetCore.Identity.CollectedClientData),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.CollectedClientData)obj).Type,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Type",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData).GetProperty("Type", 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].IsRequired = true;
            properties[0].IsGetNullable = false;
            properties[0].IsSetNullable = false;
 
            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.AspNetCore.Identity.BufferSource>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.CollectedClientData)obj).Challenge,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Challenge",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData).GetProperty("Challenge", InstanceMemberBindingFlags, null, typeof(global::Microsoft.AspNetCore.Identity.BufferSource), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.AspNetCore.Identity.BufferSource>(options, info1);
            properties[1].IsRequired = true;
            properties[1].IsGetNullable = false;
            properties[1].IsSetNullable = false;
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.CollectedClientData)obj).Origin,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Origin",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData).GetProperty("Origin", 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].IsRequired = true;
            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::Microsoft.AspNetCore.Identity.CollectedClientData),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.CollectedClientData)obj).CrossOrigin,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "CrossOrigin",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData).GetProperty("CrossOrigin", 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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.CollectedClientData)obj).TopOrigin,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "TopOrigin",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData).GetProperty("TopOrigin", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info4);
 
            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.AspNetCore.Identity.TokenBinding>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.CollectedClientData)obj).TokenBinding,
                Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "TokenBinding",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.CollectedClientData).GetProperty("TokenBinding", InstanceMemberBindingFlags, null, typeof(global::Microsoft.AspNetCore.Identity.TokenBinding), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.AspNetCore.Identity.TokenBinding>(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 CollectedClientDataSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.Identity.CollectedClientData? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            string __value_Type = ((global::Microsoft.AspNetCore.Identity.CollectedClientData)value).Type;
            if (__value_Type is not null)
            {
                writer.WriteString(PropName_type, __value_Type);
            }
            global::Microsoft.AspNetCore.Identity.BufferSource __value_Challenge = ((global::Microsoft.AspNetCore.Identity.CollectedClientData)value).Challenge;
            if (__value_Challenge is not null)
            {
                writer.WritePropertyName(PropName_challenge);
                global::System.Text.Json.JsonSerializer.Serialize(writer, __value_Challenge, BufferSource);
            }
            string __value_Origin = ((global::Microsoft.AspNetCore.Identity.CollectedClientData)value).Origin;
            if (__value_Origin is not null)
            {
                writer.WriteString(PropName_origin, __value_Origin);
            }
            bool? __value_CrossOrigin = ((global::Microsoft.AspNetCore.Identity.CollectedClientData)value).CrossOrigin;
            if (__value_CrossOrigin is not null)
            {
                writer.WritePropertyName(PropName_crossOrigin);
                global::System.Text.Json.JsonSerializer.Serialize(writer, __value_CrossOrigin, NullableBoolean);
            }
            string __value_TopOrigin = ((global::Microsoft.AspNetCore.Identity.CollectedClientData)value).TopOrigin;
            if (__value_TopOrigin is not null)
            {
                writer.WriteString(PropName_topOrigin, __value_TopOrigin);
            }
            global::Microsoft.AspNetCore.Identity.TokenBinding __value_TokenBinding = ((global::Microsoft.AspNetCore.Identity.CollectedClientData)value).TokenBinding;
            if (__value_TokenBinding is not null)
            {
                writer.WritePropertyName(PropName_tokenBinding);
                TokenBindingSerializeHandler(writer, __value_TokenBinding);
            }
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] CollectedClientDataCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "Type",
                ParameterType = typeof(string),
                Position = 0,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "Challenge",
                ParameterType = typeof(global::Microsoft.AspNetCore.Identity.BufferSource),
                Position = 1,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "Origin",
                ParameterType = typeof(string),
                Position = 2,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "CrossOrigin",
                ParameterType = typeof(bool?),
                Position = 3,
                IsNullable = true,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "TopOrigin",
                ParameterType = typeof(string),
                Position = 4,
                IsNullable = true,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "TokenBinding",
                ParameterType = typeof(global::Microsoft.AspNetCore.Identity.TokenBinding),
                Position = 5,
                IsNullable = true,
                IsMemberInitializer = true,
            },
        };
    }
}