File: Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.XAttribute.g.cs
Project: ..\..\..\test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Microsoft.Extensions.AI.Abstractions.Tests.csproj (Microsoft.Extensions.AI.Abstractions.Tests)
// <auto-generated/>
 
#nullable enable annotations
#nullable disable warnings
 
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
 
namespace Microsoft.Extensions.AI.JsonSchemaExporter
{
    public static partial class TestTypes
    {
        public partial class TestTypesContext
        {
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XAttribute>? _XAttribute;
            
            /// <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::System.Xml.Linq.XAttribute> XAttribute
            #nullable enable annotations
            {
                get => _XAttribute ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XAttribute>)Options.GetTypeInfo(typeof(global::System.Xml.Linq.XAttribute));
            }
            
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XAttribute> Create_XAttribute(global::System.Text.Json.JsonSerializerOptions options)
            {
                if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Xml.Linq.XAttribute>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XAttribute> jsonTypeInfo))
                {
                    var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::System.Xml.Linq.XAttribute>
                    {
                        ObjectCreator = null,
                        ObjectWithParameterizedConstructorCreator = null,
                        PropertyMetadataInitializer = _ => XAttributePropInit(options),
                        ConstructorParameterMetadataInitializer = null,
                        ConstructorAttributeProviderFactory = null,
                        SerializeHandler = XAttributeSerializeHandler,
                    };
                    
                    jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::System.Xml.Linq.XAttribute>(options, objectInfo);
                    jsonTypeInfo.NumberHandling = null;
                }
            
                jsonTypeInfo.OriginatingResolver = this;
                return jsonTypeInfo;
            }
 
            private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] XAttributePropInit(global::System.Text.Json.JsonSerializerOptions options)
            {
                var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[10];
 
                var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XAttribute),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XAttribute)obj).IsNamespaceDeclaration,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "IsNamespaceDeclaration",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XAttribute).GetProperty("IsNamespaceDeclaration", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info0);
 
                var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.Linq.XName>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XAttribute),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XAttribute)obj).Name,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "Name",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XAttribute).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(global::System.Xml.Linq.XName), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XName>(options, info1);
 
                var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.Linq.XAttribute>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XAttribute),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XAttribute)obj).NextAttribute,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "NextAttribute",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XAttribute).GetProperty("NextAttribute", InstanceMemberBindingFlags, null, typeof(global::System.Xml.Linq.XAttribute), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XAttribute>(options, info2);
 
                var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.XmlNodeType>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = true,
                    DeclaringType = typeof(global::System.Xml.Linq.XAttribute),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XAttribute)obj).NodeType,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "NodeType",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XAttribute).GetProperty("NodeType", InstanceMemberBindingFlags, null, typeof(global::System.Xml.XmlNodeType), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.XmlNodeType>(options, info3);
 
                var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.Linq.XAttribute>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XAttribute),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XAttribute)obj).PreviousAttribute,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "PreviousAttribute",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XAttribute).GetProperty("PreviousAttribute", InstanceMemberBindingFlags, null, typeof(global::System.Xml.Linq.XAttribute), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XAttribute>(options, info4);
 
                var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XAttribute),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XAttribute)obj).Value,
                    Setter = static (obj, value) => ((global::System.Xml.Linq.XAttribute)obj).Value = value!,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "Value",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XAttribute).GetProperty("Value", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info5);
 
                var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XObject),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XObject)obj).BaseUri,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "BaseUri",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XObject).GetProperty("BaseUri", 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);
 
                var info7 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.Linq.XDocument>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XObject),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XObject)obj).Document,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "Document",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XObject).GetProperty("Document", InstanceMemberBindingFlags, null, typeof(global::System.Xml.Linq.XDocument), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[7] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XDocument>(options, info7);
 
                var info8 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.XmlNodeType>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = true,
                    DeclaringType = typeof(global::System.Xml.Linq.XObject),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XObject)obj).NodeType,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "NodeType",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XObject).GetProperty("NodeType", InstanceMemberBindingFlags, null, typeof(global::System.Xml.XmlNodeType), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[8] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.XmlNodeType>(options, info8);
 
                var info9 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.Linq.XElement>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::System.Xml.Linq.XObject),
                    Converter = null,
                    Getter = static obj => ((global::System.Xml.Linq.XObject)obj).Parent,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "Parent",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XObject).GetProperty("Parent", InstanceMemberBindingFlags, null, typeof(global::System.Xml.Linq.XElement), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[9] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XElement>(options, info9);
 
                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 XAttributeSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Xml.Linq.XAttribute? value)
            {
                if (value is null)
                {
                    writer.WriteNullValue();
                    return;
                }
                
                writer.WriteStartObject();
 
                writer.WriteBoolean(PropName_IsNamespaceDeclaration, ((global::System.Xml.Linq.XAttribute)value).IsNamespaceDeclaration);
                writer.WritePropertyName(PropName_Name);
                XNameSerializeHandler(writer, ((global::System.Xml.Linq.XAttribute)value).Name);
                writer.WritePropertyName(PropName_NextAttribute);
                XAttributeSerializeHandler(writer, ((global::System.Xml.Linq.XAttribute)value).NextAttribute);
                writer.WritePropertyName(PropName_NodeType);
                global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::System.Xml.Linq.XAttribute)value).NodeType, XmlNodeType);
                writer.WritePropertyName(PropName_PreviousAttribute);
                XAttributeSerializeHandler(writer, ((global::System.Xml.Linq.XAttribute)value).PreviousAttribute);
                writer.WriteString(PropName_Value, ((global::System.Xml.Linq.XAttribute)value).Value);
                writer.WriteString(PropName_BaseUri, ((global::System.Xml.Linq.XObject)value).BaseUri);
                writer.WritePropertyName(PropName_Document);
                XDocumentSerializeHandler(writer, ((global::System.Xml.Linq.XObject)value).Document);
                writer.WritePropertyName(PropName_Parent);
                XElementSerializeHandler(writer, ((global::System.Xml.Linq.XObject)value).Parent);
 
                writer.WriteEndObject();
            }
        }
    }
}