File: _generated\33\DefineStaticWebAssetsSerializerContext.CopyCandidate.g.cs
Web Access
Project: src\src\sdk\src\StaticWebAssetsSdk\Tasks\Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj (Microsoft.NET.Sdk.StaticWebAssets.Tasks)
// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

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

namespace Microsoft.AspNetCore.StaticWebAssets.Tasks
{
    public partial class DefineStaticWebAssets
    {
        internal partial class DefineStaticWebAssetsSerializerContext
        {
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate>? _CopyCandidate;
            
            /// <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.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate> CopyCandidate
            #nullable enable annotations
            {
                get => _CopyCandidate ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate>)Options.GetTypeInfo(typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate));
            }
            
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate> Create_CopyCandidate(global::System.Text.Json.JsonSerializerOptions options)
            {
                if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate> jsonTypeInfo))
                {
                    var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate>
                    {
                        ObjectCreator = null,
                        ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate((string)args[0], (string)args[1]),
                        PropertyMetadataInitializer = _ => CopyCandidatePropInit(options),
                        ConstructorParameterMetadataInitializer = CopyCandidateCtorParamInit,
                        ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string)}, modifiers: null),
                        SerializeHandler = CopyCandidateSerializeHandler,
                    };
                    
                    jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate>(options, objectInfo);
                    jsonTypeInfo.NumberHandling = null;
                }
            
                jsonTypeInfo.OriginatingResolver = this;
                return jsonTypeInfo;
            }

            private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] CopyCandidatePropInit(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.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate)obj).Identity,
                    Setter = static (obj, value) => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate)obj).Identity = value!,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "Identity",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate).GetProperty("Identity", 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<string>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate)obj).TargetPath,
                    Setter = static (obj, value) => ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate)obj).TargetPath = value!,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "TargetPath",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate).GetProperty("TargetPath", 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;
                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 CopyCandidateSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate? value)
            {
                if (value is null)
                {
                    writer.WriteNullValue();
                    return;
                }
                
                writer.WriteStartObject();

                writer.WriteString(PropName_Identity, ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate)value).Identity);
                writer.WriteString(PropName_TargetPath, ((global::Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.CopyCandidate)value).TargetPath);

                writer.WriteEndObject();
            }

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

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