File: _generated\63\TestPlatformJsonContext.TestProperty.g.cs
Web Access
Project: src\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\Microsoft.TestPlatform.CommunicationUtilities.csproj (Microsoft.TestPlatform.CommunicationUtilities)
// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

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

namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities
{
    internal partial class TestPlatformJsonContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty>? _TestProperty;
        
        /// <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.VisualStudio.TestPlatform.ObjectModel.TestProperty> TestProperty
        #nullable enable annotations
        {
            get => _TestProperty ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty>)Options.GetTypeInfo(typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty> Create_TestProperty(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => TestPropertyPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = null,
                    SerializeHandler = TestPropertySerializeHandler,
                    PolymorphismOptions = new global::System.Text.Json.Serialization.Metadata.JsonPolymorphismOptions(),
                    TypeClassifierFactory = null,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

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

            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Id,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Id = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Id",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty).GetProperty("Id", 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.VisualStudio.TestPlatform.ObjectModel.TestProperty),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Label,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Label = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Label",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty).GetProperty("Label", 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<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Category,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Category = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Category",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty).GetProperty("Category", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info2);
            properties[2].IsGetNullable = false;
            properties[2].IsSetNullable = false;

            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Description,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Description = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Description",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty).GetProperty("Description", 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;
            properties[3].IsSetNullable = false;

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

            var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPropertyAttributes>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Attributes,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).Attributes = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Attributes",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty).GetProperty("Attributes", InstanceMemberBindingFlags, null, typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPropertyAttributes), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPropertyAttributes>(options, info5);

            var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).ValueType,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)obj).ValueType = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "ValueType",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty).GetProperty("ValueType", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info6);
            properties[6].IsGetNullable = false;
            properties[6].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 TestPropertySerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WriteString(PropName_Id, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)value).Id);
            writer.WriteString(PropName_Label, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)value).Label);
            writer.WriteString(PropName_Category, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)value).Category);
            writer.WriteString(PropName_Description, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)value).Description);
            writer.WritePropertyName(PropName_ValidateValueCallback);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)value).ValidateValueCallback, ValidateValueCallback);
            writer.WritePropertyName(PropName_Attributes);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)value).Attributes, TestPropertyAttributes);
            writer.WriteString(PropName_ValueType, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProperty)value).ValueType);

            writer.WriteEndObject();
        }
    }
}