File: CapabilitiesJsonContext.HandleTypeInfo.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.Commands.Sdk
{
    internal partial class CapabilitiesJsonContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.HandleTypeInfo>? _HandleTypeInfo;
        
        /// <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.Sdk.HandleTypeInfo> HandleTypeInfo
        #nullable enable annotations
        {
            get => _HandleTypeInfo ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.HandleTypeInfo>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.HandleTypeInfo> Create_HandleTypeInfo(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Commands.Sdk.HandleTypeInfo>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Commands.Sdk.HandleTypeInfo> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Commands.Sdk.HandleTypeInfo>
                {
                    ObjectCreator = () => new global::Aspire.Cli.Commands.Sdk.HandleTypeInfo(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => HandleTypeInfoPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = HandleTypeInfoSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Commands.Sdk.HandleTypeInfo>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }
 
        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] HandleTypeInfoPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[6];
 
            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).AtsTypeId,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).AtsTypeId = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "AtsTypeId",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo).GetProperty("AtsTypeId", 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;
            properties[0].IsSetNullable = false;
 
            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).IsInterface,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).IsInterface = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsInterface",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo).GetProperty("IsInterface", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info1);
 
            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).ExposeProperties,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).ExposeProperties = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ExposeProperties",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo).GetProperty("ExposeProperties", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info2);
 
            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).ExposeMethods,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).ExposeMethods = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ExposeMethods",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo).GetProperty("ExposeMethods", 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);
 
            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).ImplementedInterfaces,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).ImplementedInterfaces = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ImplementedInterfaces",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo).GetProperty("ImplementedInterfaces", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>>(options, info4);
            properties[4].IsGetNullable = false;
            properties[4].IsSetNullable = false;
 
            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo),
                Converter = null,
                Getter = static obj => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).BaseTypeHierarchy,
                Setter = static (obj, value) => ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)obj).BaseTypeHierarchy = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "BaseTypeHierarchy",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Commands.Sdk.HandleTypeInfo).GetProperty("BaseTypeHierarchy", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo>>(options, info5);
            properties[5].IsGetNullable = false;
            properties[5].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 HandleTypeInfoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Commands.Sdk.HandleTypeInfo? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();
 
            string __value_AtsTypeId = ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)value).AtsTypeId;
            if (__value_AtsTypeId is not null)
            {
                writer.WriteString(PropName_AtsTypeId, __value_AtsTypeId);
            }
            writer.WriteBoolean(PropName_IsInterface, ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)value).IsInterface);
            writer.WriteBoolean(PropName_ExposeProperties, ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)value).ExposeProperties);
            writer.WriteBoolean(PropName_ExposeMethods, ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)value).ExposeMethods);
            global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo> __value_ImplementedInterfaces = ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)value).ImplementedInterfaces;
            if (__value_ImplementedInterfaces is not null)
            {
                writer.WritePropertyName(PropName_ImplementedInterfaces);
                ListTypeRefInfoSerializeHandler(writer, __value_ImplementedInterfaces);
            }
            global::System.Collections.Generic.List<global::Aspire.Cli.Commands.Sdk.TypeRefInfo> __value_BaseTypeHierarchy = ((global::Aspire.Cli.Commands.Sdk.HandleTypeInfo)value).BaseTypeHierarchy;
            if (__value_BaseTypeHierarchy is not null)
            {
                writer.WritePropertyName(PropName_BaseTypeHierarchy);
                ListTypeRefInfoSerializeHandler(writer, __value_BaseTypeHierarchy);
            }
 
            writer.WriteEndObject();
        }
    }
}