File: _generated\62\ToolListJsonSerializerContext.VersionedDataContractToolListJsonContractArray.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.Tool.List
{
    internal partial class ToolListJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>>? _VersionedDataContractToolListJsonContractArray;
        
        /// <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.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>> VersionedDataContractToolListJsonContractArray
        #nullable enable annotations
        {
            get => _VersionedDataContractToolListJsonContractArray ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>>)Options.GetTypeInfo(typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>> Create_VersionedDataContractToolListJsonContractArray(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>(){ Data = (global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[])args[0] },
                    PropertyMetadataInitializer = _ => VersionedDataContractToolListJsonContractArrayPropInit(options),
                    ConstructorParameterMetadataInitializer = VersionedDataContractToolListJsonContractArrayCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = VersionedDataContractToolListJsonContractArraySerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] VersionedDataContractToolListJsonContractArrayPropInit(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<int>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>),
                Converter = null,
                Getter = static obj => ((global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>)obj).Version,
                Setter = static (obj, value) => __GenericAccessors_VersionedDataContractToolListJsonContractArray<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>.__set_VersionedDataContractToolListJsonContractArray_Version((global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>)obj, value!),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Version",
                JsonPropertyName = "version",
                AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>).GetProperty("Version", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int>(options, info0);

            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>),
                Converter = null,
                Getter = static obj => ((global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>)obj).Data,
                Setter = static (obj, value) => __GenericAccessors_VersionedDataContractToolListJsonContractArray<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>.__set_VersionedDataContractToolListJsonContractArray_Data((global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>)obj, value!),
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Data",
                JsonPropertyName = "data",
                AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>).GetProperty("Data", InstanceMemberBindingFlags, null, typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>(options, info1);
            properties[1].IsRequired = true;

            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 VersionedDataContractToolListJsonContractArraySerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WriteNumber(PropName_version, ((global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>)value).Version);
            writer.WritePropertyName(PropName_data);
            ToolListJsonContractArraySerializeHandler(writer, ((global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]>)value).Data);

            writer.WriteEndObject();
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] VersionedDataContractToolListJsonContractArrayCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "Data",
                ParameterType = typeof(global::Microsoft.DotNet.Cli.Commands.Tool.List.ToolListJsonContract[]),
                Position = 0,
                IsNullable = true,
                IsMemberInitializer = true,
            },
        };


        private static class __GenericAccessors_VersionedDataContractToolListJsonContractArray<TContract>
        {
            [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_Version")]
            public static extern void __set_VersionedDataContractToolListJsonContractArray_Version(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<TContract> obj, int value);
            [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_Data")]
            public static extern void __set_VersionedDataContractToolListJsonContractArray_Data(global::Microsoft.DotNet.Cli.Commands.Tool.List.VersionedDataContract<TContract> obj, TContract value);
        }
    }
}