File: Generated\361d1da7f942c932\StaticWebAssetsManifestJsonContext.AssetInfoJson.g.cs
Project: Microsoft.DotNet.HotReload.Watch.csproj (Microsoft.DotNet.HotReload.Watch)
// <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.HotReload
{
    internal sealed partial class StaticWebAssetsManifest
    {
        private sealed partial class StaticWebAssetsManifestJsonContext
        {
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson>? _AssetInfoJson;
            
            /// <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.HotReload.StaticWebAssetsManifest.AssetInfoJson> AssetInfoJson
            #nullable enable annotations
            {
                get => _AssetInfoJson ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson>)Options.GetTypeInfo(typeof(global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson));
            }
            
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson> Create_AssetInfoJson(global::System.Text.Json.JsonSerializerOptions options)
            {
                if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson> jsonTypeInfo))
                {
                    var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson>
                    {
                        ObjectCreator = null,
                        ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson(){ ContentRootIndex = (int)args[0], SubPath = (string)args[1] },
                        PropertyMetadataInitializer = _ => AssetInfoJsonPropInit(options),
                        ConstructorParameterMetadataInitializer = AssetInfoJsonCtorParamInit,
                        ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                        SerializeHandler = AssetInfoJsonSerializeHandler,
                        PolymorphismOptions = new global::System.Text.Json.Serialization.Metadata.JsonPolymorphismOptions(),
                        TypeClassifierFactory = null,
                    };
                    
                    jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson>(options, objectInfo);
                    jsonTypeInfo.NumberHandling = null;
                }
            
                jsonTypeInfo.OriginatingResolver = this;
                return jsonTypeInfo;
            }

            private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] AssetInfoJsonPropInit(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.HotReload.StaticWebAssetsManifest.AssetInfoJson),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson)obj).ContentRootIndex,
                    Setter = static (obj, value) => __set_AssetInfoJson_ContentRootIndex((global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson)obj, value!),
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "ContentRootIndex",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson).GetProperty("ContentRootIndex", 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);
                properties[0].IsRequired = true;

                var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson)obj).SubPath,
                    Setter = static (obj, value) => __set_AssetInfoJson_SubPath((global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson)obj, value!),
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "SubPath",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson).GetProperty("SubPath", 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].IsRequired = true;
                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 AssetInfoJsonSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson? value)
            {
                if (value is null)
                {
                    writer.WriteNullValue();
                    return;
                }
                
                writer.WriteStartObject();

                writer.WriteNumber(PropName_ContentRootIndex, ((global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson)value).ContentRootIndex);
                string __value_SubPath = ((global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson)value).SubPath;
                if (__value_SubPath is null)
                {
                   ThrowPropertyNullException("SubPath");
                }
                
                writer.WriteString(PropName_SubPath, __value_SubPath);

                writer.WriteEndObject();

                static void ThrowPropertyNullException(string propertyName)
                {
                    throw new global::System.Text.Json.JsonException(string.Format("The property or field '{0}' on type '{1}' doesn't allow getting null values. Consider updating its nullability annotation.", propertyName, "AssetInfoJson"));
                }
            }

            private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] AssetInfoJsonCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
            {
                new()
                {
                    Name = "ContentRootIndex",
                    ParameterType = typeof(int),
                    Position = 0,
                    IsNullable = false,
                    IsMemberInitializer = true,
                },

                new()
                {
                    Name = "SubPath",
                    ParameterType = typeof(string),
                    Position = 1,
                    IsNullable = false,
                    IsMemberInitializer = true,
                },
            };

            [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_ContentRootIndex")]
            private static extern void __set_AssetInfoJson_ContentRootIndex(global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson obj, int value);
            [global::System.Runtime.CompilerServices.UnsafeAccessorAttribute(global::System.Runtime.CompilerServices.UnsafeAccessorKind.Method, Name = "set_SubPath")]
            private static extern void __set_AssetInfoJson_SubPath(global::Microsoft.DotNet.HotReload.StaticWebAssetsManifest.AssetInfoJson obj, string value);
        }
    }
}