File: _generated\121\PackInfoJsonSerializerContext.PackInfo.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
{
    internal partial class PackInfoJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo>? _PackInfo;
        
        /// <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.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo> PackInfo
        #nullable enable annotations
        {
            get => _PackInfo ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo>)Options.GetTypeInfo(typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo> Create_PackInfo(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId)args[0], (string)args[1], (global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackKind)args[2], (string)args[3], (string)args[4]),
                    PropertyMetadataInitializer = _ => PackInfoPropInit(options),
                    ConstructorParameterMetadataInitializer = PackInfoCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId), typeof(string), typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackKind), typeof(string), typeof(string)}, modifiers: null),
                    SerializeHandler = PackInfoSerializeHandler,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PackInfoPropInit(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<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)obj).Id,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Id",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo).GetProperty("Id", InstanceMemberBindingFlags, null, typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId>(options, info0);

            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)obj).Version,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Version",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo).GetProperty("Version", 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].IsGetNullable = false;

            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackKind>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)obj).Kind,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Kind",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo).GetProperty("Kind", InstanceMemberBindingFlags, null, typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackKind), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackKind>(options, info2);

            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)obj).ResolvedPackageId,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ResolvedPackageId",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo).GetProperty("ResolvedPackageId", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info3);
            properties[3].IsGetNullable = false;

            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)obj).Path,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Path",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo).GetProperty("Path", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info4);
            properties[4].IsGetNullable = false;

            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)obj).IsStillPacked,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "IsStillPacked",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo).GetProperty("IsStillPacked", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info5);

            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 PackInfoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WritePropertyName(PropName_Id);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)value).Id, WorkloadPackId);
            writer.WriteString(PropName_Version, ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)value).Version);
            writer.WritePropertyName(PropName_Kind);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)value).Kind, WorkloadPackKind);
            writer.WriteString(PropName_ResolvedPackageId, ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)value).ResolvedPackageId);
            writer.WriteString(PropName_Path, ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)value).Path);
            writer.WriteBoolean(PropName_IsStillPacked, ((global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.PackInfo)value).IsStillPacked);

            writer.WriteEndObject();
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] PackInfoCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
        {
            new()
            {
                Name = "id",
                ParameterType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId),
                Position = 0,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },

            new()
            {
                Name = "version",
                ParameterType = typeof(string),
                Position = 1,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },

            new()
            {
                Name = "kind",
                ParameterType = typeof(global::Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackKind),
                Position = 2,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },

            new()
            {
                Name = "path",
                ParameterType = typeof(string),
                Position = 3,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },

            new()
            {
                Name = "resolvedPackageId",
                ParameterType = typeof(string),
                Position = 4,
                HasDefaultValue = false,
                DefaultValue = null,
                IsNullable = false,
            },
        };
    }
}