|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace NuGet.Protocol.Utility
{
internal partial class JsonContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry>? _V3VulnerabilityIndexEntry;
/// <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::NuGet.Protocol.Model.V3VulnerabilityIndexEntry> V3VulnerabilityIndexEntry
#nullable enable annotations
{
get => _V3VulnerabilityIndexEntry ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry>)Options.GetTypeInfo(typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry> Create_V3VulnerabilityIndexEntry(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = static args => new global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry((string)args[0], (global::System.Uri)args[1], (string)args[2], (string)args[3]),
PropertyMetadataInitializer = _ => V3VulnerabilityIndexEntryPropInit(options),
ConstructorParameterMetadataInitializer = V3VulnerabilityIndexEntryCtorParamInit,
ConstructorAttributeProviderFactory = static () => typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(global::System.Uri), typeof(string), typeof(string)}, modifiers: null),
SerializeHandler = V3VulnerabilityIndexEntrySerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] V3VulnerabilityIndexEntryPropInit(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::NuGet.Protocol.Model.V3VulnerabilityIndexEntry),
Converter = null,
Getter = static obj => ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)obj).Name,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Name",
JsonPropertyName = "@name",
AttributeProviderFactory = static () => typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry).GetProperty("Name", 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;
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Uri>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry),
Converter = null,
Getter = static obj => ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)obj).Url,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Url",
JsonPropertyName = "@id",
AttributeProviderFactory = static () => typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry).GetProperty("Url", InstanceMemberBindingFlags, null, typeof(global::System.Uri), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Uri>(options, info1);
properties[1].IsGetNullable = false;
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry),
Converter = null,
Getter = static obj => ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)obj).Updated,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Updated",
JsonPropertyName = "@updated",
AttributeProviderFactory = static () => typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry).GetProperty("Updated", 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;
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry),
Converter = null,
Getter = static obj => ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)obj).Comment,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Comment",
JsonPropertyName = "comment",
AttributeProviderFactory = static () => typeof(global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry).GetProperty("Comment", 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);
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 V3VulnerabilityIndexEntrySerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WriteString(EncodedPropName_406E616D65, ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)value).Name);
writer.WritePropertyName(EncodedPropName_406964);
global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)value).Url, Uri);
writer.WriteString(EncodedPropName_4075706461746564, ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)value).Updated);
writer.WriteString(PropName_comment, ((global::NuGet.Protocol.Model.V3VulnerabilityIndexEntry)value).Comment);
writer.WriteEndObject();
}
private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] V3VulnerabilityIndexEntryCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
{
new()
{
Name = "name",
ParameterType = typeof(string),
Position = 0,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "url",
ParameterType = typeof(global::System.Uri),
Position = 1,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "updated",
ParameterType = typeof(string),
Position = 2,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "comment",
ParameterType = typeof(string),
Position = 3,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = true,
},
};
}
}
|