File: McpInstallButtonModelContext.McpInputModel.g.cs
Project: src\src\Aspire.Dashboard\Aspire.Dashboard.csproj (Aspire.Dashboard)
// <auto-generated/>
 
#nullable enable annotations
#nullable disable warnings
 
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
 
namespace Aspire.Dashboard.Mcp
{
    public sealed partial class McpInstallButtonModelContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Mcp.McpInputModel>? _McpInputModel;
        
        /// <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::Aspire.Dashboard.Mcp.McpInputModel> McpInputModel
        #nullable enable annotations
        {
            get => _McpInputModel ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Mcp.McpInputModel>)Options.GetTypeInfo(typeof(global::Aspire.Dashboard.Mcp.McpInputModel));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Mcp.McpInputModel> Create_McpInputModel(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Dashboard.Mcp.McpInputModel>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Dashboard.Mcp.McpInputModel> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Dashboard.Mcp.McpInputModel>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Aspire.Dashboard.Mcp.McpInputModel(){ Id = (string)args[0], Type = (string)args[1], Description = (string)args[2], Password = (bool?)args[3] },
                    PropertyMetadataInitializer = _ => McpInputModelPropInit(options),
                    ConstructorParameterMetadataInitializer = McpInputModelCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Mcp.McpInputModel).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = McpInputModelSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Dashboard.Mcp.McpInputModel>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] McpInputModelPropInit(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::Aspire.Dashboard.Mcp.McpInputModel),
                Converter = null,
                Getter = static obj => ((global::Aspire.Dashboard.Mcp.McpInputModel)obj).Id,
                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 = "Id",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Mcp.McpInputModel).GetProperty("Id", 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].IsRequired = true;
            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::Aspire.Dashboard.Mcp.McpInputModel),
                Converter = null,
                Getter = static obj => ((global::Aspire.Dashboard.Mcp.McpInputModel)obj).Type,
                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 = "Type",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Mcp.McpInputModel).GetProperty("Type", 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::Aspire.Dashboard.Mcp.McpInputModel),
                Converter = null,
                Getter = static obj => ((global::Aspire.Dashboard.Mcp.McpInputModel)obj).Description,
                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 = "Description",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Mcp.McpInputModel).GetProperty("Description", 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].IsRequired = true;
            properties[2].IsGetNullable = false;
            properties[2].IsSetNullable = false;
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool?>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Dashboard.Mcp.McpInputModel),
                Converter = null,
                Getter = static obj => ((global::Aspire.Dashboard.Mcp.McpInputModel)obj).Password,
                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 = "Password",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Dashboard.Mcp.McpInputModel).GetProperty("Password", InstanceMemberBindingFlags, null, typeof(bool?), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool?>(options, info3);
 
            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 McpInputModelSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Dashboard.Mcp.McpInputModel? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            string __value_Id = ((global::Aspire.Dashboard.Mcp.McpInputModel)value).Id;
            if (__value_Id is not null)
            {
                writer.WriteString(PropName_id, __value_Id);
            }
            string __value_Type = ((global::Aspire.Dashboard.Mcp.McpInputModel)value).Type;
            if (__value_Type is not null)
            {
                writer.WriteString(PropName_type, __value_Type);
            }
            string __value_Description = ((global::Aspire.Dashboard.Mcp.McpInputModel)value).Description;
            if (__value_Description is not null)
            {
                writer.WriteString(PropName_description, __value_Description);
            }
            bool? __value_Password = ((global::Aspire.Dashboard.Mcp.McpInputModel)value).Password;
            if (__value_Password is not null)
            {
                writer.WritePropertyName(PropName_password);
                global::System.Text.Json.JsonSerializer.Serialize(writer, __value_Password, NullableBoolean);
            }
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] McpInputModelCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "Id",
                ParameterType = typeof(string),
                Position = 0,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "Type",
                ParameterType = typeof(string),
                Position = 1,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "Description",
                ParameterType = typeof(string),
                Position = 2,
                IsNullable = false,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "Password",
                ParameterType = typeof(bool?),
                Position = 3,
                IsNullable = true,
                IsMemberInitializer = true,
            },
        };
    }
}