|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Microsoft.TemplateEngine.Edge.Settings
{
internal partial class TemplateCacheJsonSerializerContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo>? _TemplateConstraintInfo;
/// <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.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo> TemplateConstraintInfo
#nullable enable annotations
{
get => _TemplateConstraintInfo ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo>)Options.GetTypeInfo(typeof(global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo> Create_TemplateConstraintInfo(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo((string)args[0], (string)args[1]),
PropertyMetadataInitializer = _ => TemplateConstraintInfoPropInit(options),
ConstructorParameterMetadataInitializer = TemplateConstraintInfoCtorParamInit,
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string)}, modifiers: null),
SerializeHandler = TemplateConstraintInfoSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] TemplateConstraintInfoPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo),
Converter = null,
Getter = static obj => ((global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo)obj).Type,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Type",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo).GetProperty("Type", 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<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo),
Converter = null,
Getter = static obj => ((global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo)obj).Args,
Setter = null,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Args",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo).GetProperty("Args", 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);
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 TemplateConstraintInfoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
string __value_Type = ((global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo)value).Type;
if (__value_Type is not null)
{
writer.WriteString(PropName_Type, __value_Type);
}
string __value_Args = ((global::Microsoft.TemplateEngine.Abstractions.Constraints.TemplateConstraintInfo)value).Args;
if (__value_Args is not null)
{
writer.WriteString(PropName_Args, __value_Args);
}
writer.WriteEndObject();
}
private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] TemplateConstraintInfoCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
{
new()
{
Name = "type",
ParameterType = typeof(string),
Position = 0,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "args",
ParameterType = typeof(string),
Position = 1,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = true,
},
};
}
}
|