// <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 { public static partial class AIJsonUtilities { private sealed partial class JsonContext { private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatClientMetadata>? _ChatClientMetadata; /// <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.ChatClientMetadata> ChatClientMetadata #nullable enable annotations { get => _ChatClientMetadata ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatClientMetadata>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ChatClientMetadata)); } private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatClientMetadata> Create_ChatClientMetadata(global::System.Text.Json.JsonSerializerOptions options) { if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ChatClientMetadata>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatClientMetadata> jsonTypeInfo)) { var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ChatClientMetadata> { ObjectCreator = null, ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.ChatClientMetadata((string)args[0], (global::System.Uri)args[1], (string)args[2]), PropertyMetadataInitializer = _ => ChatClientMetadataPropInit(options), ConstructorParameterMetadataInitializer = ChatClientMetadataCtorParamInit, ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatClientMetadata).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(global::System.Uri), typeof(string)}, modifiers: null), SerializeHandler = ChatClientMetadataSerializeHandler, }; jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ChatClientMetadata>(options, objectInfo); jsonTypeInfo.NumberHandling = null; } jsonTypeInfo.OriginatingResolver = this; return jsonTypeInfo; } private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ChatClientMetadataPropInit(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<string> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatClientMetadata), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatClientMetadata)obj).ProviderName, Setter = null, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "ProviderName", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatClientMetadata).GetProperty("ProviderName", 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); var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Uri> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatClientMetadata), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatClientMetadata)obj).ProviderUri, Setter = null, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "ProviderUri", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatClientMetadata).GetProperty("ProviderUri", InstanceMemberBindingFlags, null, typeof(global::System.Uri), global::System.Array.Empty<global::System.Type>(), null), }; properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Uri>(options, info1); var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatClientMetadata), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatClientMetadata)obj).DefaultModelId, Setter = null, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "DefaultModelId", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatClientMetadata).GetProperty("DefaultModelId", 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 ChatClientMetadataSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.ChatClientMetadata? value) { if (value is null) { writer.WriteNullValue(); return; } writer.WriteStartObject(); string __value_ProviderName = ((global::Microsoft.Extensions.AI.ChatClientMetadata)value).ProviderName; if (__value_ProviderName is not null) { writer.WriteString(PropName_providerName, __value_ProviderName); } global::System.Uri __value_ProviderUri = ((global::Microsoft.Extensions.AI.ChatClientMetadata)value).ProviderUri; if (__value_ProviderUri is not null) { writer.WritePropertyName(PropName_providerUri); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_ProviderUri, Uri); } string __value_DefaultModelId = ((global::Microsoft.Extensions.AI.ChatClientMetadata)value).DefaultModelId; if (__value_DefaultModelId is not null) { writer.WriteString(PropName_defaultModelId, __value_DefaultModelId); } writer.WriteEndObject(); } private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] ChatClientMetadataCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] { new() { Name = "providerName", ParameterType = typeof(string), Position = 0, HasDefaultValue = true, DefaultValue = default(string), IsNullable = true, }, new() { Name = "providerUri", ParameterType = typeof(global::System.Uri), Position = 1, HasDefaultValue = true, DefaultValue = default(global::System.Uri), IsNullable = true, }, new() { Name = "defaultModelId", ParameterType = typeof(string), Position = 2, HasDefaultValue = true, DefaultValue = default(string), IsNullable = true, }, }; } } }