|
// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Aspire.Cli
{
internal partial class JsonSourceGenerationContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Mcp.Docs.DocsContent>? _DocsContent;
/// <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::Aspire.Cli.Mcp.Docs.DocsContent> DocsContent
#nullable enable annotations
{
get => _DocsContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Mcp.Docs.DocsContent>)Options.GetTypeInfo(typeof(global::Aspire.Cli.Mcp.Docs.DocsContent));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Mcp.Docs.DocsContent> Create_DocsContent(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Cli.Mcp.Docs.DocsContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Cli.Mcp.Docs.DocsContent> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Cli.Mcp.Docs.DocsContent>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = static args => new global::Aspire.Cli.Mcp.Docs.DocsContent(){ Title = (string)args[0], Slug = (string)args[1], Summary = (string)args[2], Content = (string)args[3], Sections = (global::System.Collections.Generic.IReadOnlyList<string>)args[4] },
PropertyMetadataInitializer = _ => DocsContentPropInit(options),
ConstructorParameterMetadataInitializer = DocsContentCtorParamInit,
ConstructorAttributeProviderFactory = static () => typeof(global::Aspire.Cli.Mcp.Docs.DocsContent).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
SerializeHandler = DocsContentSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Cli.Mcp.Docs.DocsContent>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] DocsContentPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.Mcp.Docs.DocsContent),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.Mcp.Docs.DocsContent)obj).Title,
Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Title",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Mcp.Docs.DocsContent).GetProperty("Title", 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].IsRequired = true;
properties[0].IsGetNullable = false;
properties[0].IsSetNullable = false;
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.Mcp.Docs.DocsContent),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.Mcp.Docs.DocsContent)obj).Slug,
Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Slug",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Mcp.Docs.DocsContent).GetProperty("Slug", 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);
properties[1].IsRequired = true;
properties[1].IsGetNullable = false;
properties[1].IsSetNullable = false;
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.Mcp.Docs.DocsContent),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.Mcp.Docs.DocsContent)obj).Summary,
Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Summary",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Mcp.Docs.DocsContent).GetProperty("Summary", 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<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.Mcp.Docs.DocsContent),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.Mcp.Docs.DocsContent)obj).Content,
Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Content",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Mcp.Docs.DocsContent).GetProperty("Content", 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);
properties[3].IsRequired = true;
properties[3].IsGetNullable = false;
properties[3].IsSetNullable = false;
var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IReadOnlyList<string>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Aspire.Cli.Mcp.Docs.DocsContent),
Converter = null,
Getter = static obj => ((global::Aspire.Cli.Mcp.Docs.DocsContent)obj).Sections,
Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Sections",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Aspire.Cli.Mcp.Docs.DocsContent).GetProperty("Sections", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IReadOnlyList<string>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IReadOnlyList<string>>(options, info4);
properties[4].IsRequired = true;
properties[4].IsGetNullable = false;
properties[4].IsSetNullable = false;
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 DocsContentSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Cli.Mcp.Docs.DocsContent? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
string __value_Title = ((global::Aspire.Cli.Mcp.Docs.DocsContent)value).Title;
if (__value_Title is not null)
{
writer.WriteString(PropName_Title, __value_Title);
}
string __value_Slug = ((global::Aspire.Cli.Mcp.Docs.DocsContent)value).Slug;
if (__value_Slug is not null)
{
writer.WriteString(PropName_Slug, __value_Slug);
}
string __value_Summary = ((global::Aspire.Cli.Mcp.Docs.DocsContent)value).Summary;
if (__value_Summary is not null)
{
writer.WriteString(PropName_Summary, __value_Summary);
}
string __value_Content = ((global::Aspire.Cli.Mcp.Docs.DocsContent)value).Content;
if (__value_Content is not null)
{
writer.WriteString(PropName_Content, __value_Content);
}
global::System.Collections.Generic.IReadOnlyList<string> __value_Sections = ((global::Aspire.Cli.Mcp.Docs.DocsContent)value).Sections;
if (__value_Sections is not null)
{
writer.WritePropertyName(PropName_Sections);
IReadOnlyListStringSerializeHandler(writer, __value_Sections);
}
writer.WriteEndObject();
}
private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] DocsContentCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
{
new()
{
Name = "Title",
ParameterType = typeof(string),
Position = 0,
IsNullable = false,
IsMemberInitializer = true,
},
new()
{
Name = "Slug",
ParameterType = typeof(string),
Position = 1,
IsNullable = false,
IsMemberInitializer = true,
},
new()
{
Name = "Summary",
ParameterType = typeof(string),
Position = 2,
IsNullable = true,
IsMemberInitializer = true,
},
new()
{
Name = "Content",
ParameterType = typeof(string),
Position = 3,
IsNullable = false,
IsMemberInitializer = true,
},
new()
{
Name = "Sections",
ParameterType = typeof(global::System.Collections.Generic.IReadOnlyList<string>),
Position = 4,
IsNullable = false,
IsMemberInitializer = true,
},
};
}
}
|