// <auto-generated/> #nullable enable annotations #nullable disable warnings // Suppress warnings about [Obsolete] member usage in generated code. #pragma warning disable CS0612, CS0618 namespace Aspire.Hosting.Nats.Tests { public partial class AppJsonContext { private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Hosting.Nats.Tests.AppEvent>? _AppEvent; /// <summary> /// Defines the source generated JSON serialization contract metadata for a given type. /// </summary> public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Hosting.Nats.Tests.AppEvent> AppEvent { get => _AppEvent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Hosting.Nats.Tests.AppEvent>)Options.GetTypeInfo(typeof(global::Aspire.Hosting.Nats.Tests.AppEvent)); } private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Hosting.Nats.Tests.AppEvent> Create_AppEvent(global::System.Text.Json.JsonSerializerOptions options) { if (!TryGetTypeInfoForRuntimeCustomConverter<global::Aspire.Hosting.Nats.Tests.AppEvent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Aspire.Hosting.Nats.Tests.AppEvent> jsonTypeInfo)) { var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Aspire.Hosting.Nats.Tests.AppEvent> { ObjectCreator = null, ObjectWithParameterizedConstructorCreator = static args => new global::Aspire.Hosting.Nats.Tests.AppEvent((string)args[0], (string)args[1], (string)args[2], (decimal)args[3]), PropertyMetadataInitializer = _ => AppEventPropInit(options), ConstructorParameterMetadataInitializer = AppEventCtorParamInit, SerializeHandler = AppEventSerializeHandler }; jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Aspire.Hosting.Nats.Tests.AppEvent>(options, objectInfo); jsonTypeInfo.NumberHandling = null; } jsonTypeInfo.OriginatingResolver = this; return jsonTypeInfo; } private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] AppEventPropInit(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::Aspire.Hosting.Nats.Tests.AppEvent), Converter = null, Getter = static obj => ((global::Aspire.Hosting.Nats.Tests.AppEvent)obj).Subject, 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 = "Subject", JsonPropertyName = null }; properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info0); var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Aspire.Hosting.Nats.Tests.AppEvent), Converter = null, Getter = static obj => ((global::Aspire.Hosting.Nats.Tests.AppEvent)obj).Name, 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 = "Name", JsonPropertyName = null }; properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info1); var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Aspire.Hosting.Nats.Tests.AppEvent), Converter = null, Getter = static obj => ((global::Aspire.Hosting.Nats.Tests.AppEvent)obj).Description, 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 = "Description", JsonPropertyName = null }; properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info2); var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<decimal> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Aspire.Hosting.Nats.Tests.AppEvent), Converter = null, Getter = static obj => ((global::Aspire.Hosting.Nats.Tests.AppEvent)obj).Priority, 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 = "Priority", JsonPropertyName = null }; properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<decimal>(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 AppEventSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Aspire.Hosting.Nats.Tests.AppEvent? value) { if (value == null) { writer.WriteNullValue(); return; } writer.WriteStartObject(); writer.WriteString(PropName_Subject, ((global::Aspire.Hosting.Nats.Tests.AppEvent)value).Subject); writer.WriteString(PropName_Name, ((global::Aspire.Hosting.Nats.Tests.AppEvent)value).Name); writer.WriteString(PropName_Description, ((global::Aspire.Hosting.Nats.Tests.AppEvent)value).Description); writer.WriteNumber(PropName_Priority, ((global::Aspire.Hosting.Nats.Tests.AppEvent)value).Priority); writer.WriteEndObject(); } private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] AppEventCtorParamInit() { var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[4]; parameters[0] = new() { Name = "Subject", ParameterType = typeof(string), Position = 0, HasDefaultValue = false, DefaultValue = default(string) }; parameters[1] = new() { Name = "Name", ParameterType = typeof(string), Position = 1, HasDefaultValue = false, DefaultValue = default(string) }; parameters[2] = new() { Name = "Description", ParameterType = typeof(string), Position = 2, HasDefaultValue = false, DefaultValue = default(string) }; parameters[3] = new() { Name = "Priority", ParameterType = typeof(decimal), Position = 3, HasDefaultValue = false, DefaultValue = default(decimal) }; return parameters; } } } |