File: _generated\3\DeviceBoundSessionJsonContext.SessionInstruction.g.cs
Web Access
Project: src\aspnetcore\src\Security\Authentication\DeviceBoundSessions\src\Microsoft.AspNetCore.Authentication.DeviceBoundSessions.csproj (Microsoft.AspNetCore.Authentication.DeviceBoundSessions)
// <auto-generated/>
 
#nullable enable annotations
#nullable disable warnings
 
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
 
// Suppress warnings about [Experimental] member usage in generated code.
#pragma warning disable ASP0031
 
namespace Microsoft.AspNetCore.Authentication.DeviceBoundSessions
{
    internal sealed partial class DeviceBoundSessionJsonContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction>? _SessionInstruction;
        
        /// <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.Authentication.DeviceBoundSessions.SessionInstruction> SessionInstruction
        #nullable enable annotations
        {
            get => _SessionInstruction ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction> Create_SessionInstruction(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction>
                {
                    ObjectCreator = () => new global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => SessionInstructionPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = SessionInstructionSerializeHandler,
                    PolymorphismOptions = new global::System.Text.Json.Serialization.Metadata.JsonPolymorphismOptions(),
                    TypeClassifierFactory = null,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SessionInstructionPropInit(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.Authentication.DeviceBoundSessions.SessionInstruction),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).SessionIdentifier,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).SessionIdentifier = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "SessionIdentifier",
                JsonPropertyName = "session_identifier",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction).GetProperty("SessionIdentifier", 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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).RefreshUrl,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).RefreshUrl = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "RefreshUrl",
                JsonPropertyName = "refresh_url",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction).GetProperty("RefreshUrl", 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.Authentication.DeviceBoundSessions.SessionInstruction),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).Continue,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).Continue = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Continue",
                JsonPropertyName = "continue",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction).GetProperty("Continue", 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<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScope>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).Scope,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).Scope = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Scope",
                JsonPropertyName = "scope",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction).GetProperty("Scope", InstanceMemberBindingFlags, null, typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScope), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScope>(options, info3);
 
            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).Credentials,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).Credentials = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Credentials",
                JsonPropertyName = "credentials",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction).GetProperty("Credentials", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential>>(options, info4);
 
            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<string>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).AllowedRefreshInitiators,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)obj).AllowedRefreshInitiators = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "AllowedRefreshInitiators",
                JsonPropertyName = "allowed_refresh_initiators",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction).GetProperty("AllowedRefreshInitiators", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<string>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<string>>(options, info5);
            properties[5].IsGetNullable = false;
            properties[5].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 SessionInstructionSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            string __value_SessionIdentifier = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)value).SessionIdentifier;
            if (__value_SessionIdentifier is not null)
            {
                writer.WriteString(PropName_session_identifier, __value_SessionIdentifier);
            }
            string __value_RefreshUrl = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)value).RefreshUrl;
            if (__value_RefreshUrl is not null)
            {
                writer.WriteString(PropName_refresh_url, __value_RefreshUrl);
            }
            writer.WriteBoolean(PropName_continue, ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)value).Continue);
            global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScope __value_Scope = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)value).Scope;
            if (__value_Scope is not null)
            {
                writer.WritePropertyName(PropName_scope);
                SessionScopeSerializeHandler(writer, __value_Scope);
            }
            global::System.Collections.Generic.List<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential> __value_Credentials = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)value).Credentials;
            if (__value_Credentials is not null)
            {
                writer.WritePropertyName(PropName_credentials);
                ListSessionCredentialSerializeHandler(writer, __value_Credentials);
            }
            global::System.Collections.Generic.List<string> __value_AllowedRefreshInitiators = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionInstruction)value).AllowedRefreshInitiators;
            if (__value_AllowedRefreshInitiators is not null)
            {
                writer.WritePropertyName(PropName_allowed_refresh_initiators);
                ListStringSerializeHandler(writer, __value_AllowedRefreshInitiators);
            }
 
            writer.WriteEndObject();
        }
    }
}