// <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.XNode>? _XNode;
/// <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.XNode> XNode
#nullable enable annotations
{
get => _XNode ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNode>)Options.GetTypeInfo(typeof(global::System.Xml.Linq.XNode));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNode> Create_XNode(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Xml.Linq.XNode>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Xml.Linq.XNode> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::System.Xml.Linq.XNode>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => XNodePropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = null,
SerializeHandler = XNodeSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::System.Xml.Linq.XNode>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] XNodePropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[6];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.Linq.XNode>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::System.Xml.Linq.XNode),
Converter = null,
Getter = static obj => ((global::System.Xml.Linq.XNode)obj).NextNode,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "NextNode",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XNode).GetProperty("NextNode", InstanceMemberBindingFlags, null, typeof(global::System.Xml.Linq.XNode), global::System.Array.Empty<global::System.Type>(), null),
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XNode>(options, info0);
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Xml.Linq.XNode>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::System.Xml.Linq.XNode),
Converter = null,
Getter = static obj => ((global::System.Xml.Linq.XNode)obj).PreviousNode,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "PreviousNode",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::System.Xml.Linq.XNode).GetProperty("PreviousNode", InstanceMemberBindingFlags, null, typeof(global::System.Xml.Linq.XNode), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XNode>(options, info1);
var info2 = 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[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info2);
var info3 = 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[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XDocument>(options, info3);
var info4 = 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[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.XmlNodeType>(options, info4);
var info5 = 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[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Xml.Linq.XElement>(options, info5);
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 XNodeSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Xml.Linq.XNode? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WritePropertyName(PropName_NextNode);
XNodeSerializeHandler(writer, ((global::System.Xml.Linq.XNode)value).NextNode);
writer.WritePropertyName(PropName_PreviousNode);
XNodeSerializeHandler(writer, ((global::System.Xml.Linq.XNode)value).PreviousNode);
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_NodeType);
global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::System.Xml.Linq.XObject)value).NodeType, XmlNodeType);
writer.WritePropertyName(PropName_Parent);
XElementSerializeHandler(writer, ((global::System.Xml.Linq.XObject)value).Parent);
writer.WriteEndObject();
}
}
}
}