File: _generated\5\DeviceBoundSessionJsonContext.SessionScopeRule.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.SessionScopeRule>? _SessionScopeRule;
        
        /// <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.SessionScopeRule> SessionScopeRule
        #nullable enable annotations
        {
            get => _SessionScopeRule ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule> Create_SessionScopeRule(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule>
                {
                    ObjectCreator = () => new global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => SessionScopeRulePropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = SessionScopeRuleSerializeHandler,
                    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.SessionScopeRule>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SessionScopeRulePropInit(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.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)obj).Type,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)obj).Type = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Type",
                JsonPropertyName = "type",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule).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].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.SessionScopeRule),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)obj).Domain,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)obj).Domain = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Domain",
                JsonPropertyName = "domain",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule).GetProperty("Domain", 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);
            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.Authentication.DeviceBoundSessions.SessionScopeRule),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)obj).Path,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)obj).Path = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Path",
                JsonPropertyName = "path",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule).GetProperty("Path", 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].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 SessionScopeRuleSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            string __value_Type = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)value).Type;
            if (__value_Type is not null)
            {
                writer.WriteString(PropName_type, __value_Type);
            }
            string __value_Domain = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)value).Domain;
            if (__value_Domain is not null)
            {
                writer.WriteString(PropName_domain, __value_Domain);
            }
            string __value_Path = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionScopeRule)value).Path;
            if (__value_Path is not null)
            {
                writer.WriteString(PropName_path, __value_Path);
            }
 
            writer.WriteEndObject();
        }
    }
}