File: Generated\361d1da7f942c932\TestTypesContext.PocoWithOptionalConstructorParams.g.cs
Project: ..\..\..\test\Shared\Shared.Tests.csproj (Shared.Tests)
// <auto-generated/>
 
#nullable enable annotations
#nullable disable warnings
 
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
 
namespace Microsoft.Extensions.AI.JsonSchemaExporter
{
    public static partial class TestTypes
    {
        public partial class TestTypesContext
        {
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams>? _PocoWithOptionalConstructorParams;
            
            /// <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.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams> PocoWithOptionalConstructorParams
            #nullable enable annotations
            {
                get => _PocoWithOptionalConstructorParams ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams));
            }
            
            private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams> Create_PocoWithOptionalConstructorParams(global::System.Text.Json.JsonSerializerOptions options)
            {
                if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams> jsonTypeInfo))
                {
                    var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams>
                    {
                        ObjectCreator = null,
                        ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams((string)args[0], (int)args[1], (bool)args[2], (double)args[3], (global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum)args[4], (string)args[5], (int?)args[6], (bool?)args[7], (double?)args[8], (global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum?)args[9]),
                        PropertyMetadataInitializer = _ => PocoWithOptionalConstructorParamsPropInit(options),
                        ConstructorParameterMetadataInitializer = PocoWithOptionalConstructorParamsCtorParamInit,
                        ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(int), typeof(bool), typeof(double), typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum), typeof(string), typeof(int?), typeof(bool?), typeof(double?), typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum?)}, modifiers: null),
                        SerializeHandler = PocoWithOptionalConstructorParamsSerializeHandler,
                    };
                    
                    jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams>(options, objectInfo);
                    jsonTypeInfo.NumberHandling = null;
                }
            
                jsonTypeInfo.OriginatingResolver = this;
                return jsonTypeInfo;
            }
 
            private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PocoWithOptionalConstructorParamsPropInit(global::System.Text.Json.JsonSerializerOptions options)
            {
                var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[10];
 
                var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X1,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X1",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X1", 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<int>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X2,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X2",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X2", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int>(options, info1);
 
                var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X3,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X3",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X3", 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<double>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X4,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X4",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X4", InstanceMemberBindingFlags, null, typeof(double), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<double>(options, info3);
 
                var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X5,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X5",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X5", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum>(options, info4);
 
                var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X6,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X6",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X6", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info5);
 
                var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int?>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X7,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X7",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X7", InstanceMemberBindingFlags, null, typeof(int?), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int?>(options, info6);
 
                var info7 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool?>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X8,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X8",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X8", InstanceMemberBindingFlags, null, typeof(bool?), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[7] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool?>(options, info7);
 
                var info8 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<double?>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X9,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X9",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X9", InstanceMemberBindingFlags, null, typeof(double?), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[8] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<double?>(options, info8);
 
                var info9 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum?>
                {
                    IsProperty = true,
                    IsPublic = true,
                    IsVirtual = false,
                    DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams),
                    Converter = null,
                    Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)obj).X10,
                    Setter = null,
                    IgnoreCondition = null,
                    HasJsonInclude = false,
                    IsExtensionData = false,
                    NumberHandling = null,
                    PropertyName = "X10",
                    JsonPropertyName = null,
                    AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams).GetProperty("X10", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum?), global::System.Array.Empty<global::System.Type>(), null),
                };
                
                properties[9] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum?>(options, info9);
 
                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 PocoWithOptionalConstructorParamsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams? value)
            {
                if (value is null)
                {
                    writer.WriteNullValue();
                    return;
                }
                
                writer.WriteStartObject();
 
                writer.WriteString(PropName_X1, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X1);
                writer.WriteNumber(PropName_X2, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X2);
                writer.WriteBoolean(PropName_X3, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X3);
                writer.WriteNumber(PropName_X4, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X4);
                writer.WritePropertyName(PropName_X5);
                global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X5, StringEnum);
                writer.WriteString(PropName_X6, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X6);
                writer.WritePropertyName(PropName_X7);
                global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X7, NullableInt32);
                writer.WritePropertyName(PropName_X8);
                global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X8, NullableBoolean);
                writer.WritePropertyName(PropName_X9);
                global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X9, NullableDouble);
                writer.WritePropertyName(PropName_X10);
                global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithOptionalConstructorParams)value).X10, NullableStringEnum);
 
                writer.WriteEndObject();
            }
 
            private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] PocoWithOptionalConstructorParamsCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
            {
                new()
                {
                    Name = "x1",
                    ParameterType = typeof(string),
                    Position = 0,
                    HasDefaultValue = true,
                    DefaultValue = "str",
                    IsNullable = false,
                },
 
                new()
                {
                    Name = "x2",
                    ParameterType = typeof(int),
                    Position = 1,
                    HasDefaultValue = true,
                    DefaultValue = (int)(42),
                    IsNullable = false,
                },
 
                new()
                {
                    Name = "x3",
                    ParameterType = typeof(bool),
                    Position = 2,
                    HasDefaultValue = true,
                    DefaultValue = true,
                    IsNullable = false,
                },
 
                new()
                {
                    Name = "x4",
                    ParameterType = typeof(double),
                    Position = 3,
                    HasDefaultValue = true,
                    DefaultValue = 0D,
                    IsNullable = false,
                },
 
                new()
                {
                    Name = "x5",
                    ParameterType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum),
                    Position = 4,
                    HasDefaultValue = true,
                    DefaultValue = (global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum)(0),
                    IsNullable = false,
                },
 
                new()
                {
                    Name = "x6",
                    ParameterType = typeof(string),
                    Position = 5,
                    HasDefaultValue = true,
                    DefaultValue = "str",
                    IsNullable = true,
                },
 
                new()
                {
                    Name = "x7",
                    ParameterType = typeof(int?),
                    Position = 6,
                    HasDefaultValue = true,
                    DefaultValue = (int?)(42),
                    IsNullable = true,
                },
 
                new()
                {
                    Name = "x8",
                    ParameterType = typeof(bool?),
                    Position = 7,
                    HasDefaultValue = true,
                    DefaultValue = true,
                    IsNullable = true,
                },
 
                new()
                {
                    Name = "x9",
                    ParameterType = typeof(double?),
                    Position = 8,
                    HasDefaultValue = true,
                    DefaultValue = 0D,
                    IsNullable = true,
                },
 
                new()
                {
                    Name = "x10",
                    ParameterType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum?),
                    Position = 9,
                    HasDefaultValue = true,
                    DefaultValue = (global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.StringEnum?)(0),
                    IsNullable = true,
                },
            };
        }
    }
}