|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace NuGet.ProjectModel
{
public static partial class CacheFileFormat
{
private sealed partial class CacheFileSourceGen
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.ProjectModel.CacheFile>? _CacheFile;
/// <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.ProjectModel.CacheFile> CacheFile
#nullable enable annotations
{
get => _CacheFile ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.ProjectModel.CacheFile>)Options.GetTypeInfo(typeof(global::NuGet.ProjectModel.CacheFile));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.ProjectModel.CacheFile> Create_CacheFile(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::NuGet.ProjectModel.CacheFile>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::NuGet.ProjectModel.CacheFile> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::NuGet.ProjectModel.CacheFile>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = static args => new global::NuGet.ProjectModel.CacheFile((string)args[0]),
PropertyMetadataInitializer = _ => CacheFilePropInit(options),
ConstructorParameterMetadataInitializer = CacheFileCtorParamInit,
ConstructorAttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null),
SerializeHandler = CacheFileSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::NuGet.ProjectModel.CacheFile>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] CacheFilePropInit(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<int>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.ProjectModel.CacheFile),
Converter = null,
Getter = static obj => ((global::NuGet.ProjectModel.CacheFile)obj).Version,
Setter = static (obj, value) => ((global::NuGet.ProjectModel.CacheFile)obj).Version = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Version",
JsonPropertyName = "version",
AttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetProperty("Version", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int>(options, info0);
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.ProjectModel.CacheFile),
Converter = null,
Getter = static obj => ((global::NuGet.ProjectModel.CacheFile)obj).DgSpecHash,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "DgSpecHash",
JsonPropertyName = "dgSpecHash",
AttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetProperty("DgSpecHash", 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);
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.ProjectModel.CacheFile),
Converter = null,
Getter = static obj => ((global::NuGet.ProjectModel.CacheFile)obj).Success,
Setter = static (obj, value) => ((global::NuGet.ProjectModel.CacheFile)obj).Success = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Success",
JsonPropertyName = "success",
AttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetProperty("Success", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info2);
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.ProjectModel.CacheFile),
Converter = null,
Getter = static obj => ((global::NuGet.ProjectModel.CacheFile)obj).ProjectFilePath,
Setter = static (obj, value) => ((global::NuGet.ProjectModel.CacheFile)obj).ProjectFilePath = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "ProjectFilePath",
JsonPropertyName = "projectFilePath",
AttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetProperty("ProjectFilePath", 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);
var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IList<string>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.ProjectModel.CacheFile),
Converter = null,
Getter = static obj => ((global::NuGet.ProjectModel.CacheFile)obj).ExpectedPackageFilePaths,
Setter = static (obj, value) => ((global::NuGet.ProjectModel.CacheFile)obj).ExpectedPackageFilePaths = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "ExpectedPackageFilePaths",
JsonPropertyName = "expectedPackageFiles",
AttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetProperty("ExpectedPackageFilePaths", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<string>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IList<string>>(options, info4);
var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IList<global::NuGet.ProjectModel.IAssetsLogMessage>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.ProjectModel.CacheFile),
Converter = null,
Getter = static obj => ((global::NuGet.ProjectModel.CacheFile)obj).LogMessages,
Setter = static (obj, value) => ((global::NuGet.ProjectModel.CacheFile)obj).LogMessages = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "LogMessages",
JsonPropertyName = "logs",
AttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetProperty("LogMessages", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::NuGet.ProjectModel.IAssetsLogMessage>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IList<global::NuGet.ProjectModel.IAssetsLogMessage>>(options, info5);
var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::NuGet.ProjectModel.CacheFile),
Converter = null,
Getter = null,
Setter = null,
IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.Always,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "IsValid",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::NuGet.ProjectModel.CacheFile).GetProperty("IsValid", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
};
properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool>(options, info6);
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 CacheFileSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::NuGet.ProjectModel.CacheFile? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WriteNumber(PropName_version, ((global::NuGet.ProjectModel.CacheFile)value).Version);
writer.WriteString(PropName_dgSpecHash, ((global::NuGet.ProjectModel.CacheFile)value).DgSpecHash);
writer.WriteBoolean(PropName_success, ((global::NuGet.ProjectModel.CacheFile)value).Success);
writer.WriteString(PropName_projectFilePath, ((global::NuGet.ProjectModel.CacheFile)value).ProjectFilePath);
writer.WritePropertyName(PropName_expectedPackageFiles);
IListStringSerializeHandler(writer, ((global::NuGet.ProjectModel.CacheFile)value).ExpectedPackageFilePaths);
writer.WritePropertyName(PropName_logs);
IListIAssetsLogMessageSerializeHandler(writer, ((global::NuGet.ProjectModel.CacheFile)value).LogMessages);
writer.WriteEndObject();
}
private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] CacheFileCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
{
new()
{
Name = "dgSpecHash",
ParameterType = typeof(string),
Position = 0,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = true,
},
};
}
}
}
|