File: _generated\2\DeviceBoundSessionJsonContext.SessionCredential.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.SessionCredential>? _SessionCredential;
        
        /// <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.SessionCredential> SessionCredential
        #nullable enable annotations
        {
            get => _SessionCredential ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential> Create_SessionCredential(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential(){ Name = (string)args[0] },
                    PropertyMetadataInitializer = _ => SessionCredentialPropInit(options),
                    ConstructorParameterMetadataInitializer = SessionCredentialCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = SessionCredentialSerializeHandler,
                    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.SessionCredential>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SessionCredentialPropInit(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.SessionCredential),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)obj).Type,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Type",
                JsonPropertyName = "type",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential).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;
 
            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)obj).Name,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)obj).Name = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Name",
                JsonPropertyName = "name",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential).GetProperty("Name", 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].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.Authentication.DeviceBoundSessions.SessionCredential),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)obj).Attributes,
                Setter = static (obj, value) => ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)obj).Attributes = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Attributes",
                JsonPropertyName = "attributes",
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential).GetProperty("Attributes", 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 SessionCredentialSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            string __value_Type = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)value).Type;
            if (__value_Type is not null)
            {
                writer.WriteString(PropName_type, __value_Type);
            }
            string __value_Name = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)value).Name;
            if (__value_Name is not null)
            {
                writer.WriteString(PropName_name, __value_Name);
            }
            string __value_Attributes = ((global::Microsoft.AspNetCore.Authentication.DeviceBoundSessions.SessionCredential)value).Attributes;
            if (__value_Attributes is not null)
            {
                writer.WriteString(PropName_attributes, __value_Attributes);
            }
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] SessionCredentialCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "Name",
                ParameterType = typeof(string),
                Position = 0,
                IsNullable = false,
                IsMemberInitializer = true,
            },
        };
    }
}