File: BackchannelJsonSerializerContext.AppHostProjectSearchResultPoco.g.cs
Project: src\src\Aspire.Cli\Aspire.Cli.csproj (aspire)
// <auto-generated/>
 
#nullable enable annotations
#nullable disable warnings
 
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
 
namespace Aspire.Cli.Backchannel
{
    internal partial class BackchannelJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco>? _AppHostProjectSearchResultPoco;
        
        /// <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.Cli.Commands.AppHostProjectSearchResultPoco> AppHostProjectSearchResultPoco
        #nullable enable annotations
        {
            get => _AppHostProjectSearchResultPoco ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco> Create_AppHostProjectSearchResultPoco(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco(){ SelectedProjectFile = (string)args[0], AllProjectFileCandidates = (global::System.Collections.Generic.List<string>)args[1] },
                    PropertyMetadataInitializer = _ => AppHostProjectSearchResultPocoPropInit(options),
                    ConstructorParameterMetadataInitializer = AppHostProjectSearchResultPocoCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = AppHostProjectSearchResultPocoSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] AppHostProjectSearchResultPocoPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco)obj).SelectedProjectFile,
                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 = "SelectedProjectFile",
                JsonPropertyName = "selected_project_file",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco).GetProperty("SelectedProjectFile", 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<global::System.Collections.Generic.List<string>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco)obj).AllProjectFileCandidates,
                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 = "AllProjectFileCandidates",
                JsonPropertyName = "all_project_file_candidates",
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco).GetProperty("AllProjectFileCandidates", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<string>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<string>>(options, info1);
            properties[1].IsRequired = true;
            properties[1].IsGetNullable = false;
            properties[1].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 AppHostProjectSearchResultPocoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            writer.WriteString(PropName_selected_project_file, ((global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco)value).SelectedProjectFile);
            writer.WritePropertyName(PropName_all_project_file_candidates);
            ListStringSerializeHandler(writer, ((global::Aspire.Cli.Commands.AppHostProjectSearchResultPoco)value).AllProjectFileCandidates);
 
            writer.WriteEndObject();
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] AppHostProjectSearchResultPocoCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "SelectedProjectFile",
                ParameterType = typeof(string),
                Position = 0,
                IsNullable = true,
                IsMemberInitializer = true,
            },
 
            new()
            {
                Name = "AllProjectFileCandidates",
                ParameterType = typeof(global::System.Collections.Generic.List<string>),
                Position = 1,
                IsNullable = false,
                IsMemberInitializer = true,
            },
        };
    }
}