File: Generated\361d1da7f942c932\ProjectDataBuildJsonSerializerContext.ProjectDataBuildContextRecord.g.cs
Project: Microsoft.NET.ProjectData.Tasks.csproj (Microsoft.NET.ProjectData.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.NET.ProjectData.Tasks
{
    internal sealed partial class ProjectDataBuildJsonSerializerContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord>? _ProjectDataBuildContextRecord;
        
        /// <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.ProjectData.ProjectDataBuildContextRecord> ProjectDataBuildContextRecord
        #nullable enable annotations
        {
            get => _ProjectDataBuildContextRecord ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord>)Options.GetTypeInfo(typeof(global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord> Create_ProjectDataBuildContextRecord(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord>
                {
                    ObjectCreator = () => new global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => ProjectDataBuildContextRecordPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = ProjectDataBuildContextRecordSerializeHandler,
                    PolymorphismOptions = new global::System.Text.Json.Serialization.Metadata.JsonPolymorphismOptions(),
                    TypeClassifierFactory = null,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ProjectDataBuildContextRecordPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4];

            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)obj).Kind,
                Setter = static (obj, value) => ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)obj).Kind = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Kind",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord).GetProperty("Kind", 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.NET.ProjectData.ProjectDataBuildContextRecord),
                Converter = null,
                Getter = static obj => ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)obj).ProjectFilePath,
                Setter = static (obj, value) => ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)obj).ProjectFilePath = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ProjectFilePath",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord).GetProperty("ProjectFilePath", 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;

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

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

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

            writer.WriteString(PropName_kind, ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)value).Kind);
            writer.WriteString(PropName_projectFilePath, ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)value).ProjectFilePath);
            writer.WritePropertyName(PropName_context);
            ProjectDataBuildEventContextRecordSerializeHandler(writer, ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)value).Context);
            writer.WritePropertyName(PropName_parentContext);
            ProjectDataBuildEventContextRecordSerializeHandler(writer, ((global::Microsoft.NET.ProjectData.ProjectDataBuildContextRecord)value).ParentContext);

            writer.WriteEndObject();
        }
    }
}