diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Admin.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Admin.JsonSerializerContext.g.cs new file mode 100644 index 0000000..76a499c --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Admin.JsonSerializerContext.g.cs @@ -0,0 +1,232 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.VectorStoreFileStatus), TypeInfoPropertyName = "VectorStoreFileStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.VectorStoreFileStatus?), TypeInfoPropertyName = "NullableVectorStoreFileStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class AdminSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class AdminSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static AdminSourceGenerationContext Default { get; } = new(DefaultOptions); + + private AdminSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mixedbread.VectorStoreFileStatus) + + || typeToConvert == typeof(global::Mixedbread.VectorStoreFileStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mixedbread.VectorStoreFileStatus)) + { + return new global::Mixedbread.JsonConverters.VectorStoreFileStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.VectorStoreFileStatus?)) + { + return new global::Mixedbread.JsonConverters.VectorStoreFileStatusNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new AdminSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..35d0331 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class AdminClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..05d47bd --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class AdminClient + { + /// + + public AdminClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs index a6eada3..cba94c9 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class AdminClient : global::Mixedbread.IAdminClient, globa internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.AdminSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeys.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeys.JsonSerializerContext.g.cs new file mode 100644 index 0000000..4edea3f --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeys.JsonSerializerContext.g.cs @@ -0,0 +1,246 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ApiKey))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Scope))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ApiKeyCreateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ApiKeyCreated))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ApiKeyDeleted))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ApiKeyListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.PaginationWithTotal))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ApiKeyUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ScopeMethod), TypeInfoPropertyName = "ScopeMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringGuidObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ScopeMethod?), TypeInfoPropertyName = "NullableScopeMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringGuidObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + internal sealed partial class ApiKeysSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ApiKeysSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ApiKeysSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ApiKeysSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mixedbread.ScopeMethod) + + || typeToConvert == typeof(global::Mixedbread.ScopeMethod?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mixedbread.ScopeMethod)) + { + return new global::Mixedbread.JsonConverters.ScopeMethodJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ScopeMethod?)) + { + return new global::Mixedbread.JsonConverters.ScopeMethodNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ApiKeysSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..7115fe0 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class ApiKeysClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..d3280a0 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class ApiKeysClient + { + /// + + public ApiKeysClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs index 5a15202..20f23d4 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class ApiKeysClient : global::Mixedbread.IApiKeysClient, g internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.ApiKeysSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Billing.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Billing.JsonSerializerContext.g.cs new file mode 100644 index 0000000..9a2b2ac --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Billing.JsonSerializerContext.g.cs @@ -0,0 +1,220 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BalanceInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BillingPeriodSummary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Period))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CostInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.UsageInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CostHistogramResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DailyCostBucket))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.PhaseCostInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ProductCostInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.StoreCostInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.StoreCostListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + internal sealed partial class BillingSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class BillingSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static BillingSourceGenerationContext Default { get; } = new(DefaultOptions); + + private BillingSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new BillingSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..6d75b6f --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class BillingClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..93170a2 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class BillingClient + { + /// + + public BillingClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs index 623397c..040fbbb 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class BillingClient : global::Mixedbread.IBillingClient, g internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.BillingSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Buckets.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Buckets.JsonSerializerContext.g.cs new file mode 100644 index 0000000..256e798 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Buckets.JsonSerializerContext.g.cs @@ -0,0 +1,293 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Bucket))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketProvider), TypeInfoPropertyName = "BucketProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketAuthType), TypeInfoPropertyName = "BucketAuthType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketStatus), TypeInfoPropertyName = "BucketStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketAccessKeyCredentials))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketAssumeRoleCredentials))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketCreateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Credentials), TypeInfoPropertyName = "Credentials2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketCreateParamsCredentialsDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketCreateParamsCredentialsDiscriminatorType), TypeInfoPropertyName = "BucketCreateParamsCredentialsDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CursorPaginationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketRotateCredentialsParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketProvider?), TypeInfoPropertyName = "NullableBucketProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketAuthType?), TypeInfoPropertyName = "NullableBucketAuthType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketStatus?), TypeInfoPropertyName = "NullableBucketStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Credentials?), TypeInfoPropertyName = "NullableCredentials2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BucketCreateParamsCredentialsDiscriminatorType?), TypeInfoPropertyName = "NullableBucketCreateParamsCredentialsDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + internal sealed partial class BucketsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class BucketsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static BucketsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private BucketsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.CredentialsJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mixedbread.BucketAuthType) + + || typeToConvert == typeof(global::Mixedbread.BucketAuthType?) + + || typeToConvert == typeof(global::Mixedbread.BucketCreateParamsCredentialsDiscriminatorType) + + || typeToConvert == typeof(global::Mixedbread.BucketCreateParamsCredentialsDiscriminatorType?) + + || typeToConvert == typeof(global::Mixedbread.BucketProvider) + + || typeToConvert == typeof(global::Mixedbread.BucketProvider?) + + || typeToConvert == typeof(global::Mixedbread.BucketStatus) + + || typeToConvert == typeof(global::Mixedbread.BucketStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mixedbread.BucketAuthType)) + { + return new global::Mixedbread.JsonConverters.BucketAuthTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.BucketAuthType?)) + { + return new global::Mixedbread.JsonConverters.BucketAuthTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.BucketCreateParamsCredentialsDiscriminatorType)) + { + return new global::Mixedbread.JsonConverters.BucketCreateParamsCredentialsDiscriminatorTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.BucketCreateParamsCredentialsDiscriminatorType?)) + { + return new global::Mixedbread.JsonConverters.BucketCreateParamsCredentialsDiscriminatorTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.BucketProvider)) + { + return new global::Mixedbread.JsonConverters.BucketProviderJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.BucketProvider?)) + { + return new global::Mixedbread.JsonConverters.BucketProviderNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.BucketStatus)) + { + return new global::Mixedbread.JsonConverters.BucketStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.BucketStatus?)) + { + return new global::Mixedbread.JsonConverters.BucketStatusNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new BucketsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..42d2fd2 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class BucketsClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..f7dccdc --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class BucketsClient + { + /// + + public BucketsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.g.cs index 4279886..ab09ea5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.BucketsClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class BucketsClient : global::Mixedbread.IBucketsClient, g internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.BucketsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Completions.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Completions.JsonSerializerContext.g.cs new file mode 100644 index 0000000..985e8b5 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Completions.JsonSerializerContext.g.cs @@ -0,0 +1,184 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + internal sealed partial class CompletionsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class CompletionsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static CompletionsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private CompletionsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new CompletionsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..692df74 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class CompletionsClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..71e4f64 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class CompletionsClient + { + /// + + public CompletionsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs index e0e0a83..722b541 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class CompletionsClient : global::Mixedbread.ICompletionsC internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.CompletionsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSources.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSources.JsonSerializerContext.g.cs new file mode 100644 index 0000000..f372490 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSources.JsonSerializerContext.g.cs @@ -0,0 +1,330 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ApiKeyCreateOrUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CursorPaginationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ConnectorListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceConnector))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceType), TypeInfoPropertyName = "DataSourceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AuthParamsVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceOAuth2Params))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceApiKeyParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceAuthParamsVariant1Discriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceAuthParamsVariant1DiscriminatorType), TypeInfoPropertyName = "DataSourceAuthParamsVariant1DiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SyncStatus), TypeInfoPropertyName = "SyncStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceConnectorCreateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfInt32StringObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceConnectorDeleted))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceConnectorUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceDeleted))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AuthParamsVariant12))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.OAuth2CreateOrUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1Discriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType), TypeInfoPropertyName = "LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AuthParamsVariant13))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1Discriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType), TypeInfoPropertyName = "NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfNotionDataSourceCreateOrUpdateParamsLinearDataSourceCreateOrUpdateParams2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceType?), TypeInfoPropertyName = "NullableDataSourceType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceAuthParamsVariant1DiscriminatorType?), TypeInfoPropertyName = "NullableDataSourceAuthParamsVariant1DiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SyncStatus?), TypeInfoPropertyName = "NullableSyncStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfInt32StringObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType?), TypeInfoPropertyName = "NullableLinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType?), TypeInfoPropertyName = "NullableNotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfNotionDataSourceCreateOrUpdateParamsLinearDataSourceCreateOrUpdateParams2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + internal sealed partial class DataSourcesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class DataSourcesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static DataSourcesSourceGenerationContext Default { get; } = new(DefaultOptions); + + private DataSourcesSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AuthParamsVariant1JsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AuthParamsVariant12JsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AuthParamsVariant13JsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mixedbread.DataSourceAuthParamsVariant1DiscriminatorType) + + || typeToConvert == typeof(global::Mixedbread.DataSourceAuthParamsVariant1DiscriminatorType?) + + || typeToConvert == typeof(global::Mixedbread.DataSourceType) + + || typeToConvert == typeof(global::Mixedbread.DataSourceType?) + + || typeToConvert == typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType) + + || typeToConvert == typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType?) + + || typeToConvert == typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType) + + || typeToConvert == typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType?) + + || typeToConvert == typeof(global::Mixedbread.SyncStatus) + + || typeToConvert == typeof(global::Mixedbread.SyncStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mixedbread.DataSourceAuthParamsVariant1DiscriminatorType)) + { + return new global::Mixedbread.JsonConverters.DataSourceAuthParamsVariant1DiscriminatorTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.DataSourceAuthParamsVariant1DiscriminatorType?)) + { + return new global::Mixedbread.JsonConverters.DataSourceAuthParamsVariant1DiscriminatorTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.DataSourceType)) + { + return new global::Mixedbread.JsonConverters.DataSourceTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.DataSourceType?)) + { + return new global::Mixedbread.JsonConverters.DataSourceTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType)) + { + return new global::Mixedbread.JsonConverters.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType?)) + { + return new global::Mixedbread.JsonConverters.LinearDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType)) + { + return new global::Mixedbread.JsonConverters.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorType?)) + { + return new global::Mixedbread.JsonConverters.NotionDataSourceCreateOrUpdateParamsAuthParamsVariant1DiscriminatorTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.SyncStatus)) + { + return new global::Mixedbread.JsonConverters.SyncStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.SyncStatus?)) + { + return new global::Mixedbread.JsonConverters.SyncStatusNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new DataSourcesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..8e350fd --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class DataSourcesClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..dd9575e --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class DataSourcesClient + { + /// + + public DataSourcesClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs index 47e65af..bf3689c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class DataSourcesClient : global::Mixedbread.IDataSourcesC internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.DataSourcesSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Extractions.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Extractions.JsonSerializerContext.g.cs new file mode 100644 index 0000000..36cf52a --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Extractions.JsonSerializerContext.g.cs @@ -0,0 +1,259 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CreatedJsonSchema))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.EnhancedJsonSchema))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ExtractContentCreateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf, global::System.Collections.Generic.IList>>), TypeInfoPropertyName = "AnyOfStringIListStringIListAnyOfTextInputImageUrlInput22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfTextInputImageUrlInput22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.TextInput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ImageUrlInput2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ExtractJobCreateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ExtractionJob))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobStatus), TypeInfoPropertyName = "ParsingJobStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ExtractionResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ImageUrlInput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.JsonSchemaCreateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.JsonSchemaEnhanceParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.JsonSchemaValidateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.MultiModalQueryVariant2), TypeInfoPropertyName = "MultiModalQueryVariant22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidatedJsonSchema))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf, global::System.Collections.Generic.IList>>?), TypeInfoPropertyName = "NullableAnyOfStringIListStringIListAnyOfTextInputImageUrlInput22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfTextInputImageUrlInput22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobStatus?), TypeInfoPropertyName = "NullableParsingJobStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.MultiModalQueryVariant2?), TypeInfoPropertyName = "NullableMultiModalQueryVariant22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf, global::System.Collections.Generic.List>>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + internal sealed partial class ExtractionsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ExtractionsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ExtractionsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ExtractionsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.MultiModalQueryVariant2JsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter, global::System.Collections.Generic.IList>>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mixedbread.ParsingJobStatus) + + || typeToConvert == typeof(global::Mixedbread.ParsingJobStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mixedbread.ParsingJobStatus)) + { + return new global::Mixedbread.JsonConverters.ParsingJobStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ParsingJobStatus?)) + { + return new global::Mixedbread.JsonConverters.ParsingJobStatusNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ExtractionsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..88f0ff1 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class ExtractionsClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..1918899 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class ExtractionsClient + { + /// + + public ExtractionsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs index 0a566ea..16353df 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class ExtractionsClient : global::Mixedbread.IExtractionsC internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.ExtractionsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Files.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Files.JsonSerializerContext.g.cs new file mode 100644 index 0000000..69b29ea --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Files.JsonSerializerContext.g.cs @@ -0,0 +1,226 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BodyCreateFile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.BodyUpdateFile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CursorPaginationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CompleteMultipartUploadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.MultipartUploadPart))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CreateMultipartUploadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CreateMultipartUploadResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.MultipartUploadPartUrl))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.FileDeleted))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.FileListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.FileObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.MultipartUploadDetailResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.MultipartUploadListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.MultipartUploadObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + internal sealed partial class FilesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class FilesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static FilesSourceGenerationContext Default { get; } = new(DefaultOptions); + + private FilesSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new FilesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..642ef9c --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class FilesClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..99a22c9 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class FilesClient + { + /// + + public FilesClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.g.cs index d48484c..a2da67a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class FilesClient : global::Mixedbread.IFilesClient, globa internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.FilesSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IAdminClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IAdminClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..f1d43ff --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IAdminClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IAdminClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..2393585 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IApiKeysClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..2f6518e --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IBillingClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IBucketsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IBucketsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..3b76d4d --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IBucketsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IBucketsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ICompletionsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ICompletionsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..1879340 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ICompletionsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface ICompletionsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..d92f68d --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IDataSourcesClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..cc6538e --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IExtractionsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..85e35e5 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IFilesClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IIntegrationsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IIntegrationsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..3849106 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IIntegrationsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IIntegrationsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..655d38b --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IParsingClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ISchemasClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ISchemasClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..d06074f --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ISchemasClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface ISchemasClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..c9d3083 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mixedbread +{ + public partial interface IStoresClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Integrations.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Integrations.JsonSerializerContext.g.cs new file mode 100644 index 0000000..0f8fe37 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Integrations.JsonSerializerContext.g.cs @@ -0,0 +1,365 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CursorPaginationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceInstallation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DataSourceInstallationListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveFolder))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveFolderSelection))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveFolderSelectionResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveFolderSelectionUpdate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveFolderSelectionUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveFolderSelectionUpdateResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveInstallationConfigUpdateBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveInstallationOverview))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveInstallationOverviewListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveSync))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveSyncParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.GoogleDriveSyncResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationInstallation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationInstallationListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationInstallationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestProvider), TypeInfoPropertyName = "IntegrationProviderManifestProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestAuthType), TypeInfoPropertyName = "IntegrationProviderManifestAuthType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestCapabilitie), TypeInfoPropertyName = "IntegrationProviderManifestCapabilitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestIngestionBacking), TypeInfoPropertyName = "IntegrationProviderManifestIngestionBacking2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSyncStatus), TypeInfoPropertyName = "SlackChannelSyncStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelLastSyncStatus), TypeInfoPropertyName = "SlackChannelLastSyncStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSelection))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSelectionResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSelectionUpdate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSelectionUpdateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSelectionUpdateResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSync))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSyncParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSyncResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackInstallationConfigUpdateBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackInstallationOverview))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackInstallationOverviewListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackManifestResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackManualConnectBody))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestProvider?), TypeInfoPropertyName = "NullableIntegrationProviderManifestProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestAuthType?), TypeInfoPropertyName = "NullableIntegrationProviderManifestAuthType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestCapabilitie?), TypeInfoPropertyName = "NullableIntegrationProviderManifestCapabilitie2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.IntegrationProviderManifestIngestionBacking?), TypeInfoPropertyName = "NullableIntegrationProviderManifestIngestionBacking2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelSyncStatus?), TypeInfoPropertyName = "NullableSlackChannelSyncStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.SlackChannelLastSyncStatus?), TypeInfoPropertyName = "NullableSlackChannelLastSyncStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + internal sealed partial class IntegrationsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class IntegrationsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static IntegrationsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private IntegrationsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestProvider) + + || typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestProvider?) + + || typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestAuthType) + + || typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestAuthType?) + + || typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestCapabilitie) + + || typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestCapabilitie?) + + || typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestIngestionBacking) + + || typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestIngestionBacking?) + + || typeToConvert == typeof(global::Mixedbread.SlackChannelSyncStatus) + + || typeToConvert == typeof(global::Mixedbread.SlackChannelSyncStatus?) + + || typeToConvert == typeof(global::Mixedbread.SlackChannelLastSyncStatus) + + || typeToConvert == typeof(global::Mixedbread.SlackChannelLastSyncStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestProvider)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestProviderJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestProvider?)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestProviderNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestAuthType)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestAuthTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestAuthType?)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestAuthTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestCapabilitie)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestCapabilitieJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestCapabilitie?)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestCapabilitieNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestIngestionBacking)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestIngestionBackingJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.IntegrationProviderManifestIngestionBacking?)) + { + return new global::Mixedbread.JsonConverters.IntegrationProviderManifestIngestionBackingNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.SlackChannelSyncStatus)) + { + return new global::Mixedbread.JsonConverters.SlackChannelSyncStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.SlackChannelSyncStatus?)) + { + return new global::Mixedbread.JsonConverters.SlackChannelSyncStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.SlackChannelLastSyncStatus)) + { + return new global::Mixedbread.JsonConverters.SlackChannelLastSyncStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.SlackChannelLastSyncStatus?)) + { + return new global::Mixedbread.JsonConverters.SlackChannelLastSyncStatusNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new IntegrationsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..cbb6668 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class IntegrationsClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..963de86 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class IntegrationsClient + { + /// + + public IntegrationsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.g.cs index ca34bf7..d8fe745 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IntegrationsClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class IntegrationsClient : global::Mixedbread.IIntegration internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.IntegrationsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Parsing.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Parsing.JsonSerializerContext.g.cs new file mode 100644 index 0000000..89d612a --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Parsing.JsonSerializerContext.g.cs @@ -0,0 +1,322 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.CursorPaginationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Chunk))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ChunkElement))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ElementType), TypeInfoPropertyName = "ElementType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ChunkingStrategy), TypeInfoPropertyName = "ChunkingStrategy2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.DocumentParserResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ReturnFormat), TypeInfoPropertyName = "ReturnFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobStatus), TypeInfoPropertyName = "ParsingJobStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.HTTPValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Mode), TypeInfoPropertyName = "Mode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJob))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobCreateParams))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobDeleted))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobListItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ElementType?), TypeInfoPropertyName = "NullableElementType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ChunkingStrategy?), TypeInfoPropertyName = "NullableChunkingStrategy2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ReturnFormat?), TypeInfoPropertyName = "NullableReturnFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.ParsingJobStatus?), TypeInfoPropertyName = "NullableParsingJobStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.Mode?), TypeInfoPropertyName = "NullableMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mixedbread.AnyOf?), TypeInfoPropertyName = "NullableAnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class ParsingSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ParsingSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ParsingSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ParsingSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mixedbread.ChunkingStrategy) + + || typeToConvert == typeof(global::Mixedbread.ChunkingStrategy?) + + || typeToConvert == typeof(global::Mixedbread.ElementType) + + || typeToConvert == typeof(global::Mixedbread.ElementType?) + + || typeToConvert == typeof(global::Mixedbread.Mode) + + || typeToConvert == typeof(global::Mixedbread.Mode?) + + || typeToConvert == typeof(global::Mixedbread.ParsingJobStatus) + + || typeToConvert == typeof(global::Mixedbread.ParsingJobStatus?) + + || typeToConvert == typeof(global::Mixedbread.ReturnFormat) + + || typeToConvert == typeof(global::Mixedbread.ReturnFormat?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mixedbread.ChunkingStrategy)) + { + return new global::Mixedbread.JsonConverters.ChunkingStrategyJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ChunkingStrategy?)) + { + return new global::Mixedbread.JsonConverters.ChunkingStrategyNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ElementType)) + { + return new global::Mixedbread.JsonConverters.ElementTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ElementType?)) + { + return new global::Mixedbread.JsonConverters.ElementTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.Mode)) + { + return new global::Mixedbread.JsonConverters.ModeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.Mode?)) + { + return new global::Mixedbread.JsonConverters.ModeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ParsingJobStatus)) + { + return new global::Mixedbread.JsonConverters.ParsingJobStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ParsingJobStatus?)) + { + return new global::Mixedbread.JsonConverters.ParsingJobStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ReturnFormat)) + { + return new global::Mixedbread.JsonConverters.ReturnFormatJsonConverter(); + } + + if (typeToConvert == typeof(global::Mixedbread.ReturnFormat?)) + { + return new global::Mixedbread.JsonConverters.ReturnFormatNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ParsingSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..591479e --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class ParsingClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..eec7e66 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class ParsingClient + { + /// + + public ParsingClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs index 9867c5f..4d8601b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class ParsingClient : global::Mixedbread.IParsingClient, g internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.ParsingSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.Schemas.JsonSerializerContext.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.Schemas.JsonSerializerContext.g.cs new file mode 100644 index 0000000..ecd0245 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.Schemas.JsonSerializerContext.g.cs @@ -0,0 +1,184 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mixedbread +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + internal sealed partial class SchemasSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class SchemasSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static SchemasSourceGenerationContext Default { get; } = new(DefaultOptions); + + private SchemasSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>, object>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter>()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.AnyOfJsonConverter()); + options.Converters.Add(new global::Mixedbread.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new SchemasSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..70a6957 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class SchemasClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..513f7c5 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class SchemasClient + { + /// + + public SchemasClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs index 9cd0eb3..2a027c5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs @@ -37,7 +37,7 @@ public sealed partial class SchemasClient : global::Mixedbread.ISchemasClient, g internal global::Mixedbread.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Mixedbread.AutoSDKServerConfiguration(); - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mixedbread.SchemasSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.Authorizations.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..baf498b --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class StoresClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mixedbread.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.Constructors.Bearer.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..d5fd7e5 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mixedbread +{ + public sealed partial class StoresClient + { + /// + + public StoresClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file