File: IdentityEndpointsJsonSerializerContext.TwoFactorRequest.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.Data
{
    internal sealed partial class IdentityEndpointsJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest>? _TwoFactorRequest;
        
        /// <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.Data.TwoFactorRequest> TwoFactorRequest
        #nullable enable annotations
        {
            get => _TwoFactorRequest ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest> Create_TwoFactorRequest(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest(){ Enable = (bool?)args[0], TwoFactorCode = (string)args[1], ResetSharedKey = (bool)args[2], ResetRecoveryCodes = (bool)args[3], ForgetMachine = (bool)args[4] },
                    PropertyMetadataInitializer = _ => TwoFactorRequestPropInit(options),
                    ConstructorParameterMetadataInitializer = TwoFactorRequestCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = TwoFactorRequestSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] TwoFactorRequestPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool?>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)obj).Enable,
                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 = "Enable",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest).GetProperty("Enable", InstanceMemberBindingFlags, null, typeof(bool?), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool?>(options, info0);
 
            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)obj).TwoFactorCode,
                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 = "TwoFactorCode",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest).GetProperty("TwoFactorCode", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info1);
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)obj).ResetSharedKey,
                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 = "ResetSharedKey",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest).GetProperty("ResetSharedKey", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info2);
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)obj).ResetRecoveryCodes,
                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 = "ResetRecoveryCodes",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest).GetProperty("ResetRecoveryCodes", 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<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)obj).ForgetMachine,
                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 = "ForgetMachine",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest).GetProperty("ForgetMachine", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info4);
 
            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 TwoFactorRequestSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WritePropertyName(PropName_Enable);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)value).Enable, NullableBoolean);
            writer.WriteString(PropName_TwoFactorCode, ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)value).TwoFactorCode);
            writer.WriteBoolean(PropName_ResetSharedKey, ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)value).ResetSharedKey);
            writer.WriteBoolean(PropName_ResetRecoveryCodes, ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)value).ResetRecoveryCodes);
            writer.WriteBoolean(PropName_ForgetMachine, ((global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest)value).ForgetMachine);
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] TwoFactorRequestCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "Enable",
                ParameterType = typeof(bool?),
                Position = 0,
                IsNullable = true,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "TwoFactorCode",
                ParameterType = typeof(string),
                Position = 1,
                IsNullable = true,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "ResetSharedKey",
                ParameterType = typeof(bool),
                Position = 2,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "ResetRecoveryCodes",
                ParameterType = typeof(bool),
                Position = 3,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "ForgetMachine",
                ParameterType = typeof(bool),
                Position = 4,
                IsNullable = false,
                IsMemberInitializer = true,
            },
        };
    }
}