File: _generated\1\PluginCredentialResponseJsonContext.PluginCredentialResponse.g.cs
Web Access
Project: src\nuget-client\src\NuGet.Core\NuGet.Credentials\NuGet.Credentials.csproj (NuGet.Credentials)
// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618

namespace NuGet.Credentials
{
    internal partial class PluginCredentialResponseJsonContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Credentials.PluginCredentialResponse>? _PluginCredentialResponse;
        
        /// <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::NuGet.Credentials.PluginCredentialResponse> PluginCredentialResponse
        #nullable enable annotations
        {
            get => _PluginCredentialResponse ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Credentials.PluginCredentialResponse>)Options.GetTypeInfo(typeof(global::NuGet.Credentials.PluginCredentialResponse));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Credentials.PluginCredentialResponse> Create_PluginCredentialResponse(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::NuGet.Credentials.PluginCredentialResponse>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Credentials.PluginCredentialResponse> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::NuGet.Credentials.PluginCredentialResponse>
                {
                    ObjectCreator = () => new global::NuGet.Credentials.PluginCredentialResponse(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => PluginCredentialResponsePropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::NuGet.Credentials.PluginCredentialResponse).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = PluginCredentialResponseSerializeHandler,
                    PolymorphismOptions = new global::System.Text.Json.Serialization.Metadata.JsonPolymorphismOptions(),
                    TypeClassifierFactory = null,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::NuGet.Credentials.PluginCredentialResponse>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PluginCredentialResponsePropInit(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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::NuGet.Credentials.PluginCredentialResponse),
                Converter = null,
                Getter = static obj => ((global::NuGet.Credentials.PluginCredentialResponse)obj).Username,
                Setter = static (obj, value) => ((global::NuGet.Credentials.PluginCredentialResponse)obj).Username = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Username",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::NuGet.Credentials.PluginCredentialResponse).GetProperty("Username", 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);

            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::NuGet.Credentials.PluginCredentialResponse),
                Converter = null,
                Getter = static obj => ((global::NuGet.Credentials.PluginCredentialResponse)obj).Password,
                Setter = static (obj, value) => ((global::NuGet.Credentials.PluginCredentialResponse)obj).Password = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Password",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::NuGet.Credentials.PluginCredentialResponse).GetProperty("Password", 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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::NuGet.Credentials.PluginCredentialResponse),
                Converter = null,
                Getter = static obj => ((global::NuGet.Credentials.PluginCredentialResponse)obj).Message,
                Setter = static (obj, value) => ((global::NuGet.Credentials.PluginCredentialResponse)obj).Message = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Message",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::NuGet.Credentials.PluginCredentialResponse).GetProperty("Message", 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);

            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IList<string>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::NuGet.Credentials.PluginCredentialResponse),
                Converter = null,
                Getter = static obj => ((global::NuGet.Credentials.PluginCredentialResponse)obj).AuthTypes,
                Setter = static (obj, value) => ((global::NuGet.Credentials.PluginCredentialResponse)obj).AuthTypes = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "AuthTypes",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::NuGet.Credentials.PluginCredentialResponse).GetProperty("AuthTypes", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<string>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IList<string>>(options, info3);

            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::NuGet.Credentials.PluginCredentialResponse),
                Converter = null,
                Getter = static obj => ((global::NuGet.Credentials.PluginCredentialResponse)obj).IsValid,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsValid",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::NuGet.Credentials.PluginCredentialResponse).GetProperty("IsValid", 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 PluginCredentialResponseSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::NuGet.Credentials.PluginCredentialResponse? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WriteString(PropName_Username, ((global::NuGet.Credentials.PluginCredentialResponse)value).Username);
            writer.WriteString(PropName_Password, ((global::NuGet.Credentials.PluginCredentialResponse)value).Password);
            writer.WriteString(PropName_Message, ((global::NuGet.Credentials.PluginCredentialResponse)value).Message);
            writer.WritePropertyName(PropName_AuthTypes);
            IListStringSerializeHandler(writer, ((global::NuGet.Credentials.PluginCredentialResponse)value).AuthTypes);
            writer.WriteBoolean(PropName_IsValid, ((global::NuGet.Credentials.PluginCredentialResponse)value).IsValid);

            writer.WriteEndObject();
        }
    }
}