File: _generated\92\WorkloadListJsonSerializerContext.ListOutput.g.cs
Web Access
Project: src\src\sdk\src\Cli\dotnet\dotnet.csproj (dotnet)
// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

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

namespace Microsoft.DotNet.Cli.Commands.Workload.List
{
    internal partial class WorkloadListJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput>? _ListOutput;
        
        /// <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.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput> ListOutput
        #nullable enable annotations
        {
            get => _ListOutput ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput>)Options.GetTypeInfo(typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput> Create_ListOutput(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput((string[])args[0], (global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.UpdateAvailableEntry[])args[1]),
                    PropertyMetadataInitializer = _ => ListOutputPropInit(options),
                    ConstructorParameterMetadataInitializer = ListOutputCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string[]), typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.UpdateAvailableEntry[])}, modifiers: null),
                    SerializeHandler = ListOutputSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ListOutputPropInit(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::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput),
                Converter = null,
                Getter = static obj => ((global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput)obj).Installed,
                Setter = static (obj, value) => __set_ListOutput_Installed((global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput)obj, value!),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Installed",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput).GetProperty("Installed", 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::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.UpdateAvailableEntry[]>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput),
                Converter = null,
                Getter = static obj => ((global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput)obj).UpdateAvailable,
                Setter = static (obj, value) => __set_ListOutput_UpdateAvailable((global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput)obj, value!),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "UpdateAvailable",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput).GetProperty("UpdateAvailable", InstanceMemberBindingFlags, null, typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.UpdateAvailableEntry[]), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.UpdateAvailableEntry[]>(options, info1);

            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 ListOutputSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WritePropertyName(PropName_installed);
            StringArraySerializeHandler(writer, ((global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput)value).Installed);
            writer.WritePropertyName(PropName_updateAvailable);
            UpdateAvailableEntryArraySerializeHandler(writer, ((global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput)value).UpdateAvailable);

            writer.WriteEndObject();
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] ListOutputCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "Installed",
                ParameterType = typeof(string[]),
                Position = 0,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = true,
            },

            new()
            {
                Name = "UpdateAvailable",
                ParameterType = typeof(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.UpdateAvailableEntry[]),
                Position = 1,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = true,
            },
        };

        [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_Installed")]
        private static extern void __set_ListOutput_Installed(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput obj, string[] value);
        [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_UpdateAvailable")]
        private static extern void __set_ListOutput_UpdateAvailable(global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.ListOutput obj, global::Microsoft.DotNet.Cli.Commands.Workload.List.WorkloadListCommand.UpdateAvailableEntry[] value);
    }
}