|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Microsoft.DotNet.Cli.Commands.Workload
{
internal partial class InstallStateJsonSerializerContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents>? _InstallStateContents;
/// <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.DotNet.Cli.Commands.Workload.InstallStateContents> InstallStateContents
#nullable enable annotations
{
get => _InstallStateContents ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents>)Options.GetTypeInfo(typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents> Create_InstallStateContents(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents>
{
ObjectCreator = () => new global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents(),
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => InstallStateContentsPropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
SerializeHandler = InstallStateContentsSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] InstallStateContentsPropInit(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<bool?>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents),
Converter = null,
Getter = static obj => ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)obj).UseWorkloadSets,
Setter = static (obj, value) => ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)obj).UseWorkloadSets = value!,
IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "UseWorkloadSets",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents).GetProperty("UseWorkloadSets", 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.Collections.Generic.Dictionary<string, string>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents),
Converter = null,
Getter = static obj => ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)obj).Manifests,
Setter = static (obj, value) => ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)obj).Manifests = value!,
IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Manifests",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents).GetProperty("Manifests", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.Dictionary<string, string>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.Dictionary<string, string>>(options, info1);
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents),
Converter = null,
Getter = static obj => ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)obj).WorkloadVersion,
Setter = static (obj, value) => ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)obj).WorkloadVersion = value!,
IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "WorkloadVersion",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents).GetProperty("WorkloadVersion", 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);
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 InstallStateContentsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
bool? __value_UseWorkloadSets = ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)value).UseWorkloadSets;
if (__value_UseWorkloadSets is not null)
{
writer.WritePropertyName(PropName_useWorkloadSets);
global::System.Text.Json.JsonSerializer.Serialize(writer, __value_UseWorkloadSets, NullableBoolean);
}
global::System.Collections.Generic.Dictionary<string, string> __value_Manifests = ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)value).Manifests;
if (__value_Manifests is not null)
{
writer.WritePropertyName(PropName_manifests);
DictionaryStringStringSerializeHandler(writer, __value_Manifests);
}
string __value_WorkloadVersion = ((global::Microsoft.DotNet.Cli.Commands.Workload.InstallStateContents)value).WorkloadVersion;
if (__value_WorkloadVersion is not null)
{
writer.WriteString(PropName_workloadVersion, __value_WorkloadVersion);
}
writer.WriteEndObject();
}
}
}
|