File: _generated\29\TestPlatformJsonContext.AttachmentSet.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.AttachmentSet>? _AttachmentSet;
        
        /// <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.AttachmentSet> AttachmentSet
        #nullable enable annotations
        {
            get => _AttachmentSet ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet>)Options.GetTypeInfo(typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet> Create_AttachmentSet(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet>
                {
                    ObjectCreator = null,
                    ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet((global::System.Uri)args[0], (string)args[1]),
                    PropertyMetadataInitializer = _ => AttachmentSetPropInit(options),
                    ConstructorParameterMetadataInitializer = AttachmentSetCtorParamInit,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::System.Uri), typeof(string)}, modifiers: null),
                    SerializeHandler = AttachmentSetSerializeHandler,
                    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.AttachmentSet>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

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

            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Uri>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet)obj).Uri,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Uri",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet).GetProperty("Uri", InstanceMemberBindingFlags, null, typeof(global::System.Uri), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Uri>(options, info0);
            properties[0].IsGetNullable = 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.AttachmentSet),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet)obj).DisplayName,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "DisplayName",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet).GetProperty("DisplayName", 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::System.Collections.Generic.IList<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.UriDataAttachment>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet)obj).Attachments,
                Setter = null,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Attachments",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet).GetProperty("Attachments", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.UriDataAttachment>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IList<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.UriDataAttachment>>(options, info2);
            properties[2].IsGetNullable = 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 AttachmentSetSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WritePropertyName(PropName_Uri);
            global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet)value).Uri, Uri);
            writer.WriteString(PropName_DisplayName, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet)value).DisplayName);
            writer.WritePropertyName(PropName_Attachments);
            IListUriDataAttachmentSerializeHandler(writer, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet)value).Attachments);

            writer.WriteEndObject();
        }

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

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