File: BearerTokenJsonSerializerContext.AccessTokenResponse.g.cs
Project: src\src\Security\Authentication\BearerToken\src\Microsoft.AspNetCore.Authentication.BearerToken.csproj (Microsoft.AspNetCore.Authentication.BearerToken)
// <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.Authentication.BearerToken
{
    internal sealed partial class BearerTokenJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>? _AccessTokenResponse;
        
        /// <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.BearerToken.AccessTokenResponse> AccessTokenResponse
        #nullable enable annotations
        {
            get => _AccessTokenResponse ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse> Create_AccessTokenResponse(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse(){ AccessToken = (string)args[0], ExpiresIn = (long)args[1], RefreshToken = (string)args[2] },
                    PropertyMetadataInitializer = _ => AccessTokenResponsePropInit(options),
                    ConstructorParameterMetadataInitializer = AccessTokenResponseCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = AccessTokenResponseSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] AccessTokenResponsePropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)obj).TokenType,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "TokenType",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse).GetProperty("TokenType", 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.BearerToken.AccessTokenResponse),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)obj).AccessToken,
                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 = "AccessToken",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse).GetProperty("AccessToken", 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<long>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)obj).ExpiresIn,
                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 = "ExpiresIn",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse).GetProperty("ExpiresIn", InstanceMemberBindingFlags, null, typeof(long), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<long>(options, info2);
            properties[2].IsRequired = true;
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse),
                Converter = null,
                Getter = static obj => ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)obj).RefreshToken,
                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 = "RefreshToken",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse).GetProperty("RefreshToken", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info3);
            properties[3].IsRequired = true;
            properties[3].IsGetNullable = false;
            properties[3].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 AccessTokenResponseSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WriteString(PropName_TokenType, ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)value).TokenType);
            writer.WriteString(PropName_AccessToken, ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)value).AccessToken);
            writer.WriteNumber(PropName_ExpiresIn, ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)value).ExpiresIn);
            writer.WriteString(PropName_RefreshToken, ((global::Microsoft.AspNetCore.Authentication.BearerToken.AccessTokenResponse)value).RefreshToken);
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] AccessTokenResponseCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "AccessToken",
                ParameterType = typeof(string),
                Position = 0,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "ExpiresIn",
                ParameterType = typeof(long),
                Position = 1,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "RefreshToken",
                ParameterType = typeof(string),
                Position = 2,
                IsNullable = false,
                IsMemberInitializer = true,
            },
        };
    }
}