From 1458e3286f29418c4e6a4be1d3ec78fd5ef9b903 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 May 2026 14:18:47 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...edbread.AdminClient.ReingestAllStores.g.cs | 81 +- .../Generated/Mixedbread.AdminClient.g.cs | 8 +- ...Mixedbread.ApiKeysClient.CreateApiKey.g.cs | 70 +- ...Mixedbread.ApiKeysClient.DeleteApiKey.g.cs | 70 +- .../Mixedbread.ApiKeysClient.ListApiKeys.g.cs | 81 +- ...Mixedbread.ApiKeysClient.RerollApiKey.g.cs | 71 +- ...xedbread.ApiKeysClient.RetrieveApiKey.g.cs | 70 +- ...Mixedbread.ApiKeysClient.RevokeApiKey.g.cs | 70 +- ...Mixedbread.ApiKeysClient.UpdateApiKey.g.cs | 76 +- .../Generated/Mixedbread.ApiKeysClient.g.cs | 8 +- .../Mixedbread.AutoSDKHttpResponse.g.cs | 121 ++ ...bread.BillingClient.GetBillingSummary.g.cs | 60 +- ...BillingClient.GetParsingCostHistogram.g.cs | 60 +- ...d.BillingClient.GetStoreCostHistogram.g.cs | 65 +- ...bread.BillingClient.ListStoreCostInfo.g.cs | 60 +- .../Generated/Mixedbread.BillingClient.g.cs | 8 +- ...ompletionsClient.CreateChatCompletion.g.cs | 67 +- .../Mixedbread.CompletionsClient.g.cs | 8 +- ...DataSourcesClient.AuthorizeDataSource.g.cs | 72 +- ...ead.DataSourcesClient.CreateConnector.g.cs | 76 +- ...ad.DataSourcesClient.CreateDataSource.g.cs | 70 +- ...ead.DataSourcesClient.DeleteConnector.g.cs | 76 +- ...ad.DataSourcesClient.DeleteDataSource.g.cs | 68 +- ...dbread.DataSourcesClient.GetConnector.g.cs | 76 +- ...bread.DataSourcesClient.GetDataSource.g.cs | 70 +- ...read.DataSourcesClient.ListConnectors.g.cs | 97 +- ...ead.DataSourcesClient.ListDataSources.g.cs | 89 +- ...read.DataSourcesClient.Oauth2Callback.g.cs | 88 +- ...ead.DataSourcesClient.UpdateConnector.g.cs | 82 +- ...ad.DataSourcesClient.UpdateDataSource.g.cs | 76 +- .../Mixedbread.DataSourcesClient.g.cs | 8 +- ...ExtractionsClient.CreateExtractionJob.g.cs | 70 +- ...dbread.ExtractionsClient.CreateSchema.g.cs | 70 +- ...bread.ExtractionsClient.EnhanceSchema.g.cs | 70 +- ...read.ExtractionsClient.ExtractContent.g.cs | 70 +- ...tractionsClient.RetrieveExtractionJob.g.cs | 70 +- ...read.ExtractionsClient.ValidateSchema.g.cs | 70 +- .../Mixedbread.ExtractionsClient.g.cs | 8 +- ...read.FilesClient.AbortMultipartUpload.g.cs | 66 +- ...d.FilesClient.CompleteMultipartUpload.g.cs | 72 +- .../Mixedbread.FilesClient.CreateFile.g.cs | 994 +++++++++++++++- ...ead.FilesClient.CreateMultipartUpload.g.cs | 66 +- .../Mixedbread.FilesClient.DeleteFile.g.cs | 70 +- .../Mixedbread.FilesClient.DownloadFile.g.cs | 427 ++++++- ...dbread.FilesClient.GetMultipartUpload.g.cs | 66 +- .../Mixedbread.FilesClient.ListFiles.g.cs | 96 +- ...read.FilesClient.ListMultipartUploads.g.cs | 61 +- .../Mixedbread.FilesClient.RetrieveFile.g.cs | 70 +- .../Mixedbread.FilesClient.UpdateFile.g.cs | 1023 +++++++++++++++- .../Generated/Mixedbread.FilesClient.g.cs | 8 +- ...dbread.IAdminClient.ReingestAllStores.g.cs | 26 + ...ixedbread.IApiKeysClient.CreateApiKey.g.cs | 17 + ...ixedbread.IApiKeysClient.DeleteApiKey.g.cs | 18 + ...Mixedbread.IApiKeysClient.ListApiKeys.g.cs | 24 + ...ixedbread.IApiKeysClient.RerollApiKey.g.cs | 19 + ...edbread.IApiKeysClient.RetrieveApiKey.g.cs | 18 + ...ixedbread.IApiKeysClient.RevokeApiKey.g.cs | 18 + ...ixedbread.IApiKeysClient.UpdateApiKey.g.cs | 22 + ...read.IBillingClient.GetBillingSummary.g.cs | 9 + ...BillingClient.GetParsingCostHistogram.g.cs | 9 + ....IBillingClient.GetStoreCostHistogram.g.cs | 13 + ...read.IBillingClient.ListStoreCostInfo.g.cs | 9 + ...ompletionsClient.CreateChatCompletion.g.cs | 20 + ...DataSourcesClient.AuthorizeDataSource.g.cs | 24 + ...ad.IDataSourcesClient.CreateConnector.g.cs | 22 + ...d.IDataSourcesClient.CreateDataSource.g.cs | 17 + ...ad.IDataSourcesClient.DeleteConnector.g.cs | 23 + ...d.IDataSourcesClient.DeleteDataSource.g.cs | 16 + ...bread.IDataSourcesClient.GetConnector.g.cs | 23 + ...read.IDataSourcesClient.GetDataSource.g.cs | 18 + ...ead.IDataSourcesClient.ListConnectors.g.cs | 37 + ...ad.IDataSourcesClient.ListDataSources.g.cs | 30 + ...ead.IDataSourcesClient.Oauth2Callback.g.cs | 39 + ...ad.IDataSourcesClient.UpdateConnector.g.cs | 27 + ...d.IDataSourcesClient.UpdateDataSource.g.cs | 22 + ...ExtractionsClient.CreateExtractionJob.g.cs | 17 + ...bread.IExtractionsClient.CreateSchema.g.cs | 17 + ...read.IExtractionsClient.EnhanceSchema.g.cs | 17 + ...ead.IExtractionsClient.ExtractContent.g.cs | 17 + ...tractionsClient.RetrieveExtractionJob.g.cs | 18 + ...ead.IExtractionsClient.ValidateSchema.g.cs | 17 + ...ead.IFilesClient.AbortMultipartUpload.g.cs | 14 + ....IFilesClient.CompleteMultipartUpload.g.cs | 18 + .../Mixedbread.IFilesClient.CreateFile.g.cs | 62 + ...ad.IFilesClient.CreateMultipartUpload.g.cs | 13 + .../Mixedbread.IFilesClient.DeleteFile.g.cs | 18 + .../Mixedbread.IFilesClient.DownloadFile.g.cs | 36 + ...bread.IFilesClient.GetMultipartUpload.g.cs | 14 + .../Mixedbread.IFilesClient.ListFiles.g.cs | 36 + ...ead.IFilesClient.ListMultipartUploads.g.cs | 10 + .../Mixedbread.IFilesClient.RetrieveFile.g.cs | 18 + .../Mixedbread.IFilesClient.UpdateFile.g.cs | 77 ++ ...ad.IMixedbreadClient.CreateEmbeddings.g.cs | 17 + .../Mixedbread.IMixedbreadClient.Info.g.cs | 12 + .../Mixedbread.IMixedbreadClient.Rerank.g.cs | 17 + ...bread.IParsingClient.CancelParsingJob.g.cs | 18 + ...bread.IParsingClient.CreateParsingJob.g.cs | 17 + ...bread.IParsingClient.DeleteParsingJob.g.cs | 18 + ...dbread.IParsingClient.ListParsingJobs.g.cs | 41 + ...ead.IParsingClient.RetrieveParsingJob.g.cs | 18 + ...ead.ISchemasClient.GetMxbaiJsonSchema.g.cs | 12 + ...IStoresClient.CreateQuestionAnswering.g.cs | 12 + ...dbread.IStoresClient.CreateSearchRule.g.cs | 22 + .../Mixedbread.IStoresClient.CreateStore.g.cs | 17 + ...edbread.IStoresClient.CreateStoreFile.g.cs | 22 + ...dbread.IStoresClient.DeleteSearchRule.g.cs | 23 + ...StoresClient.DeleteSpecificSearchRule.g.cs | 27 + .../Mixedbread.IStoresClient.DeleteStore.g.cs | 18 + ...edbread.IStoresClient.DeleteStoreFile.g.cs | 23 + ...bread.IStoresClient.GetMetadataFacets.g.cs | 12 + ....IStoresClient.GetStoreEventHistogram.g.cs | 22 + ...edbread.IStoresClient.ListStoreEvents.g.cs | 49 + ...ient.ListStoreFilesWithMetadataFilter.g.cs | 22 + .../Mixedbread.IStoresClient.ListStores.g.cs | 37 + ...read.IStoresClient.RetrieveSearchRule.g.cs | 23 + ...ixedbread.IStoresClient.RetrieveStore.g.cs | 18 + ...bread.IStoresClient.RetrieveStoreFile.g.cs | 29 + ...bread.IStoresClient.SearchStoreChunks.g.cs | 35 + ...dbread.IStoresClient.UpdateSearchRule.g.cs | 27 + .../Mixedbread.IStoresClient.UpdateStore.g.cs | 22 + ...edbread.IStoresClient.UpdateStoreFile.g.cs | 27 + ...edbread.IStoresClient.UploadStoreFile.g.cs | 87 ++ ...ead.MixedbreadClient.CreateEmbeddings.g.cs | 70 +- .../Mixedbread.MixedbreadClient.Info.g.cs | 63 +- .../Mixedbread.MixedbreadClient.Rerank.g.cs | 70 +- .../Mixedbread.MixedbreadClient.g.cs | 28 +- .../Generated/Mixedbread.OptionsSupport.g.cs | 231 +++- ...dbread.ParsingClient.CancelParsingJob.g.cs | 70 +- ...dbread.ParsingClient.CreateParsingJob.g.cs | 70 +- ...dbread.ParsingClient.DeleteParsingJob.g.cs | 70 +- ...edbread.ParsingClient.ListParsingJobs.g.cs | 102 +- ...read.ParsingClient.RetrieveParsingJob.g.cs | 70 +- .../Generated/Mixedbread.ParsingClient.g.cs | 8 +- .../Generated/Mixedbread.ResponseStream.g.cs | 117 ++ ...read.SchemasClient.GetMxbaiJsonSchema.g.cs | 59 +- .../Generated/Mixedbread.SchemasClient.g.cs | 8 +- ....StoresClient.CreateQuestionAnswering.g.cs | 67 +- ...edbread.StoresClient.CreateSearchRule.g.cs | 76 +- .../Mixedbread.StoresClient.CreateStore.g.cs | 70 +- ...xedbread.StoresClient.CreateStoreFile.g.cs | 76 +- ...edbread.StoresClient.DeleteSearchRule.g.cs | 76 +- ...StoresClient.DeleteSpecificSearchRule.g.cs | 82 +- .../Mixedbread.StoresClient.DeleteStore.g.cs | 70 +- ...xedbread.StoresClient.DeleteStoreFile.g.cs | 76 +- ...dbread.StoresClient.GetMetadataFacets.g.cs | 65 +- ...d.StoresClient.GetStoreEventHistogram.g.cs | 76 +- ...xedbread.StoresClient.ListStoreEvents.g.cs | 112 +- ...ient.ListStoreFilesWithMetadataFilter.g.cs | 76 +- .../Mixedbread.StoresClient.ListStores.g.cs | 97 +- ...bread.StoresClient.RetrieveSearchRule.g.cs | 76 +- ...Mixedbread.StoresClient.RetrieveStore.g.cs | 70 +- ...dbread.StoresClient.RetrieveStoreFile.g.cs | 87 +- ...dbread.StoresClient.SearchStoreChunks.g.cs | 88 +- ...edbread.StoresClient.UpdateSearchRule.g.cs | 82 +- .../Mixedbread.StoresClient.UpdateStore.g.cs | 76 +- ...xedbread.StoresClient.UpdateStoreFile.g.cs | 82 +- ...xedbread.StoresClient.UploadStoreFile.g.cs | 1055 ++++++++++++++++- .../Generated/Mixedbread.StoresClient.g.cs | 8 +- 158 files changed, 10166 insertions(+), 645 deletions(-) create mode 100644 src/libs/Mixedbread/Generated/Mixedbread.AutoSDKHttpResponse.g.cs create mode 100644 src/libs/Mixedbread/Generated/Mixedbread.ResponseStream.g.cs diff --git a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.ReingestAllStores.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.ReingestAllStores.g.cs index 1307a9a..7801219 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.ReingestAllStores.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.ReingestAllStores.g.cs @@ -96,6 +96,44 @@ partial void ProcessReingestAllStoresResponseContent( bool? billable = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReingestAllStoresAsResponseAsync( + organizationId: organizationId, + storeIdentifier: storeIdentifier, + statuses: statuses, + billable: billable, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reingest all stores
+ /// Reingest all stores across all organizations (admin only).
+ /// This endpoint creates StoreFileReingestionJob for each store.
+ /// Returns:
+ /// dict: Confirmation message with count of jobs created. + ///
+ /// + /// + /// + /// Statuses of files to reingest + /// + /// + /// Whether the reingestion is billable to the user
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ReingestAllStoresAsResponseAsync( + global::System.Guid organizationId, + string storeIdentifier, + global::System.Collections.Generic.IList? statuses = default, + bool? billable = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -128,14 +166,15 @@ partial void ProcessReingestAllStoresResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/admin/stores/{organizationId}/{storeIdentifier}/reingest", baseUri: ResolveBaseUri( servers: s_ReingestAllStoresServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("statuses", statuses?.ToString()) - .AddOptionalParameter("billable", billable?.ToString().ToLowerInvariant()) + .AddOptionalParameter("billable", billable?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -210,6 +249,8 @@ partial void ProcessReingestAllStoresResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -220,6 +261,11 @@ partial void ProcessReingestAllStoresResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -237,6 +283,8 @@ partial void ProcessReingestAllStoresResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -246,8 +294,7 @@ partial void ProcessReingestAllStoresResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -256,6 +303,11 @@ partial void ProcessReingestAllStoresResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -272,14 +324,15 @@ partial void ProcessReingestAllStoresResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -319,6 +372,8 @@ partial void ProcessReingestAllStoresResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -339,6 +394,8 @@ partial void ProcessReingestAllStoresResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -401,7 +458,11 @@ partial void ProcessReingestAllStoresResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -429,7 +490,11 @@ partial void ProcessReingestAllStoresResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs index 1b86c63..6f72ec4 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.AdminClient.g.cs @@ -113,10 +113,10 @@ public AdminClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AdminClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.CreateApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.CreateApiKey.g.cs index 9ae3bf6..fe4aa7d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.CreateApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.CreateApiKey.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateApiKeyResponseContent( /// public async global::System.Threading.Tasks.Task CreateApiKeyAsync( + global::Mixedbread.ApiKeyCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateApiKeyAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create API key
+ /// Create a new API key.
+ /// Args:
+ /// params: The parameters for creating the API key.
+ /// Returns:
+ /// ApiKeyCreated: The response containing the details of the created API key. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateApiKeyAsResponseAsync( + global::Mixedbread.ApiKeyCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessCreateApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/api-keys", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessCreateApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessCreateApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessCreateApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessCreateApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessCreateApiKeyResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessCreateApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessCreateApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessCreateApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessCreateApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ApiKeyCreated.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ApiKeyCreated.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessCreateApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ApiKeyCreated.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ApiKeyCreated.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.DeleteApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.DeleteApiKey.g.cs index deec3a2..e23634d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.DeleteApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.DeleteApiKey.g.cs @@ -82,6 +82,33 @@ partial void ProcessDeleteApiKeyResponseContent( global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteApiKeyAsResponseAsync( + apiKeyId: apiKeyId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete API key
+ /// Delete a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to delete.
+ /// Returns:
+ /// ApiKeyDeleted: The response containing the details of the deleted API key. + ///
+ /// + /// The ID of the API key to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessDeleteApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/api-keys/{apiKeyId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessDeleteApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessDeleteApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessDeleteApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessDeleteApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessDeleteApiKeyResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessDeleteApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessDeleteApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessDeleteApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessDeleteApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ApiKeyDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ApiKeyDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessDeleteApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ApiKeyDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ApiKeyDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.ListApiKeys.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.ListApiKeys.g.cs index 15e9a9a..01cf546 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.ListApiKeys.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.ListApiKeys.g.cs @@ -90,6 +90,40 @@ partial void ProcessListApiKeysResponseContent( int? offset = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListApiKeysAsResponseAsync( + limit: limit, + offset: offset, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List API keys
+ /// List all API keys for the authenticated user.
+ /// Args:
+ /// pagination: The pagination options
+ /// Returns:
+ /// A list of API keys belonging to the user. + ///
+ /// + /// Maximum number of items to return per page
+ /// Default Value: 100 + /// + /// + /// Offset of the first item to return
+ /// Default Value: 0 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListApiKeysAsResponseAsync( + int? limit = default, + int? offset = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -120,14 +154,15 @@ partial void ProcessListApiKeysResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/api-keys", baseUri: ResolveBaseUri( servers: s_ListApiKeysServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("offset", offset?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -200,6 +235,8 @@ partial void ProcessListApiKeysResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -210,6 +247,11 @@ partial void ProcessListApiKeysResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -227,6 +269,8 @@ partial void ProcessListApiKeysResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -236,8 +280,7 @@ partial void ProcessListApiKeysResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -246,6 +289,11 @@ partial void ProcessListApiKeysResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -262,14 +310,15 @@ partial void ProcessListApiKeysResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +358,8 @@ partial void ProcessListApiKeysResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -329,6 +380,8 @@ partial void ProcessListApiKeysResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -391,9 +444,13 @@ partial void ProcessListApiKeysResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ApiKeyListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ApiKeyListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -421,9 +478,13 @@ partial void ProcessListApiKeysResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ApiKeyListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ApiKeyListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RerollApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RerollApiKey.g.cs index 06ca085..5986cfd 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RerollApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RerollApiKey.g.cs @@ -83,6 +83,34 @@ partial void ProcessRerollApiKeyResponseContent( global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RerollApiKeyAsResponseAsync( + apiKeyId: apiKeyId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reroll API key
+ /// Reroll the secret for a specific API key by its ID.
+ /// This generates a new secret key, invalidating the old one.
+ /// Args:
+ /// api_key_id: The ID of the API key to reroll.
+ /// Returns:
+ /// ApiKeyCreated: The response containing the API key details with the new secret key. + ///
+ /// + /// The ID of the API key to reroll + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RerollApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,6 +140,7 @@ partial void ProcessRerollApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/api-keys/{apiKeyId}/reroll", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessRerollApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessRerollApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessRerollApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessRerollApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessRerollApiKeyResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessRerollApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessRerollApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessRerollApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessRerollApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ApiKeyCreated.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ApiKeyCreated.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessRerollApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ApiKeyCreated.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ApiKeyCreated.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RetrieveApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RetrieveApiKey.g.cs index 6516b41..b74d0ea 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RetrieveApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RetrieveApiKey.g.cs @@ -82,6 +82,33 @@ partial void ProcessRetrieveApiKeyResponseContent( global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveApiKeyAsResponseAsync( + apiKeyId: apiKeyId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get API key details
+ /// Retrieve details of a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to retrieve.
+ /// Returns:
+ /// ApiKey: The response containing the API key details. + ///
+ /// + /// The ID of the API key to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessRetrieveApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/api-keys/{apiKeyId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessRetrieveApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessRetrieveApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessRetrieveApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessRetrieveApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessRetrieveApiKeyResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessRetrieveApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessRetrieveApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessRetrieveApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessRetrieveApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessRetrieveApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RevokeApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RevokeApiKey.g.cs index 3eb6c78..5ece23f 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RevokeApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.RevokeApiKey.g.cs @@ -82,6 +82,33 @@ partial void ProcessRevokeApiKeyResponseContent( global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RevokeApiKeyAsResponseAsync( + apiKeyId: apiKeyId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Revoke API key
+ /// Revoke a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to revoke.
+ /// Returns:
+ /// ApiKey: The response containing the details of the revoked API key. + ///
+ /// + /// The ID of the API key to revoke + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RevokeApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessRevokeApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/api-keys/{apiKeyId}/revoke", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessRevokeApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessRevokeApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessRevokeApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessRevokeApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessRevokeApiKeyResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessRevokeApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessRevokeApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessRevokeApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessRevokeApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessRevokeApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.UpdateApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.UpdateApiKey.g.cs index e110325..298f54a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.UpdateApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.UpdateApiKey.g.cs @@ -85,6 +85,39 @@ partial void ProcessUpdateApiKeyResponseContent( public async global::System.Threading.Tasks.Task UpdateApiKeyAsync( global::System.Guid apiKeyId, + global::Mixedbread.ApiKeyUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateApiKeyAsResponseAsync( + apiKeyId: apiKeyId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update API key
+ /// Update a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to update.
+ /// params: The parameters to update.
+ /// Returns:
+ /// ApiKey: The updated API key details. + ///
+ /// + /// The ID of the API key to update + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.ApiKeyUpdateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,6 +153,7 @@ partial void ProcessUpdateApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/api-keys/{apiKeyId}", baseUri: ResolveBaseUri( @@ -202,6 +236,8 @@ partial void ProcessUpdateApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessUpdateApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessUpdateApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessUpdateApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessUpdateApiKeyResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessUpdateApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessUpdateApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessUpdateApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -393,9 +445,13 @@ partial void ProcessUpdateApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -423,9 +479,13 @@ partial void ProcessUpdateApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs index c76fda1..5353738 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ApiKeysClient.g.cs @@ -113,10 +113,10 @@ public ApiKeysClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ApiKeysClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.AutoSDKHttpResponse.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..545c6a4 --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Mixedbread +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetBillingSummary.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetBillingSummary.g.cs index 48467b1..4c1e253 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetBillingSummary.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetBillingSummary.g.cs @@ -71,6 +71,23 @@ partial void ProcessGetBillingSummaryResponseContent( public async global::System.Threading.Tasks.Task GetBillingSummaryAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetBillingSummaryAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get billing summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetBillingSummaryAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -99,6 +116,7 @@ partial void ProcessGetBillingSummaryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/billing/summary", baseUri: ResolveBaseUri( @@ -173,6 +191,8 @@ partial void ProcessGetBillingSummaryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +203,11 @@ partial void ProcessGetBillingSummaryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +225,8 @@ partial void ProcessGetBillingSummaryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +236,7 @@ partial void ProcessGetBillingSummaryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +245,11 @@ partial void ProcessGetBillingSummaryResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +266,15 @@ partial void ProcessGetBillingSummaryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +314,8 @@ partial void ProcessGetBillingSummaryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +336,8 @@ partial void ProcessGetBillingSummaryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,9 +362,13 @@ partial void ProcessGetBillingSummaryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.BillingPeriodSummary.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.BillingPeriodSummary.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -356,9 +396,13 @@ partial void ProcessGetBillingSummaryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.BillingPeriodSummary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.BillingPeriodSummary.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetParsingCostHistogram.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetParsingCostHistogram.g.cs index eab90ab..87aa7dd 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetParsingCostHistogram.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetParsingCostHistogram.g.cs @@ -71,6 +71,23 @@ partial void ProcessGetParsingCostHistogramResponseContent( public async global::System.Threading.Tasks.Task GetParsingCostHistogramAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetParsingCostHistogramAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get parsing cost histogram + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetParsingCostHistogramAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -99,6 +116,7 @@ partial void ProcessGetParsingCostHistogramResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/billing/parsing/costs/histogram", baseUri: ResolveBaseUri( @@ -173,6 +191,8 @@ partial void ProcessGetParsingCostHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +203,11 @@ partial void ProcessGetParsingCostHistogramResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +225,8 @@ partial void ProcessGetParsingCostHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +236,7 @@ partial void ProcessGetParsingCostHistogramResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +245,11 @@ partial void ProcessGetParsingCostHistogramResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +266,15 @@ partial void ProcessGetParsingCostHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +314,8 @@ partial void ProcessGetParsingCostHistogramResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +336,8 @@ partial void ProcessGetParsingCostHistogramResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,9 +362,13 @@ partial void ProcessGetParsingCostHistogramResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.CostHistogramResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.CostHistogramResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -356,9 +396,13 @@ partial void ProcessGetParsingCostHistogramResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.CostHistogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.CostHistogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetStoreCostHistogram.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetStoreCostHistogram.g.cs index f29e328..28ce269 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetStoreCostHistogram.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.GetStoreCostHistogram.g.cs @@ -77,6 +77,28 @@ partial void ProcessGetStoreCostHistogramResponseContent( global::System.Guid storeId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetStoreCostHistogramAsResponseAsync( + storeId: storeId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get store cost histogram + /// + /// + /// The ID of the store + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetStoreCostHistogramAsResponseAsync( + global::System.Guid storeId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -106,6 +128,7 @@ partial void ProcessGetStoreCostHistogramResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/billing/stores/{storeId}/costs/histogram", baseUri: ResolveBaseUri( @@ -181,6 +204,8 @@ partial void ProcessGetStoreCostHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +216,11 @@ partial void ProcessGetStoreCostHistogramResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +238,8 @@ partial void ProcessGetStoreCostHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +249,7 @@ partial void ProcessGetStoreCostHistogramResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +258,11 @@ partial void ProcessGetStoreCostHistogramResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +279,15 @@ partial void ProcessGetStoreCostHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +327,8 @@ partial void ProcessGetStoreCostHistogramResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +349,8 @@ partial void ProcessGetStoreCostHistogramResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -372,9 +413,13 @@ partial void ProcessGetStoreCostHistogramResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.CostHistogramResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.CostHistogramResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -402,9 +447,13 @@ partial void ProcessGetStoreCostHistogramResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.CostHistogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.CostHistogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.ListStoreCostInfo.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.ListStoreCostInfo.g.cs index 1fc8d87..5873336 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.ListStoreCostInfo.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.ListStoreCostInfo.g.cs @@ -71,6 +71,23 @@ partial void ProcessListStoreCostInfoResponseContent( public async global::System.Threading.Tasks.Task ListStoreCostInfoAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListStoreCostInfoAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List store cost information + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListStoreCostInfoAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -99,6 +116,7 @@ partial void ProcessListStoreCostInfoResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/billing/stores", baseUri: ResolveBaseUri( @@ -173,6 +191,8 @@ partial void ProcessListStoreCostInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +203,11 @@ partial void ProcessListStoreCostInfoResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +225,8 @@ partial void ProcessListStoreCostInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +236,7 @@ partial void ProcessListStoreCostInfoResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +245,11 @@ partial void ProcessListStoreCostInfoResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +266,15 @@ partial void ProcessListStoreCostInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +314,8 @@ partial void ProcessListStoreCostInfoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +336,8 @@ partial void ProcessListStoreCostInfoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,9 +362,13 @@ partial void ProcessListStoreCostInfoResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreCostListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreCostListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -356,9 +396,13 @@ partial void ProcessListStoreCostInfoResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreCostListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreCostListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs index 47385eb..954b505 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.BillingClient.g.cs @@ -113,10 +113,10 @@ public BillingClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BillingClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.CreateChatCompletion.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.CreateChatCompletion.g.cs index 65bc1e5..aa47ecc 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.CreateChatCompletion.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.CreateChatCompletion.g.cs @@ -82,6 +82,34 @@ partial void ProcessCreateChatCompletionResponseContent( public async global::System.Threading.Tasks.Task CreateChatCompletionAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateChatCompletionAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a chat completion
+ /// Create a chat completion using the provided parameters.
+ /// Generates a completion response based on the chat messages and model parameters provided.
+ /// The response can be either a full completion or streamed chunks depending on the request parameters.
+ /// Args:
+ /// params: Parameters for creating the chat completion including messages, model selection,
+ /// and generation settings
+ /// user: The authenticated user making the request
+ /// Returns:
+ /// Either a ChatCompletion containing the full response, or ChatCompletionChunk for streaming
+ /// Raises:
+ /// HTTPException: If there is an error creating the completion (500) + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateChatCompletionAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,6 +138,7 @@ partial void ProcessCreateChatCompletionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/chat/completions", baseUri: ResolveBaseUri( @@ -184,6 +213,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +225,11 @@ partial void ProcessCreateChatCompletionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +247,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +258,7 @@ partial void ProcessCreateChatCompletionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +267,11 @@ partial void ProcessCreateChatCompletionResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +288,15 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +336,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +358,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -337,7 +384,11 @@ partial void ProcessCreateChatCompletionResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -365,7 +416,11 @@ partial void ProcessCreateChatCompletionResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs index e3e57f9..b795db6 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.CompletionsClient.g.cs @@ -113,10 +113,10 @@ public CompletionsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public CompletionsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.AuthorizeDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.AuthorizeDataSource.g.cs index d1f6c80..829cdda 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.AuthorizeDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.AuthorizeDataSource.g.cs @@ -88,6 +88,39 @@ partial void ProcessAuthorizeDataSourceResponseContent( global::System.Guid dataSourceId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AuthorizeDataSourceAsResponseAsync( + dataSourceId: dataSourceId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Authorize a data source
+ /// Start OAuth2 authorization flow for a data source.
+ /// Initiates the OAuth2 authorization process by redirecting the user
+ /// to the external service's authorization page. After authorization,
+ /// the user will be redirected back to the oauth2_callback endpoint.
+ /// Args:
+ /// data_source_id: The ID of the data source to authorize
+ /// Returns:
+ /// Redirect to the OAuth2 provider's authorization page
+ /// Raises:
+ /// DataSourceNotFoundError: When data source doesn't exist
+ /// DataSourceAuthTypeNotSupportedError: When OAuth2 is not supported for this data source type + ///
+ /// + /// The ID of the data source to authorize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AuthorizeDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -117,6 +150,7 @@ partial void ProcessAuthorizeDataSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}/oauth2/authorize", baseUri: ResolveBaseUri( @@ -192,6 +226,8 @@ partial void ProcessAuthorizeDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +238,11 @@ partial void ProcessAuthorizeDataSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +260,8 @@ partial void ProcessAuthorizeDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +271,7 @@ partial void ProcessAuthorizeDataSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +280,11 @@ partial void ProcessAuthorizeDataSourceResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +301,15 @@ partial void ProcessAuthorizeDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +349,8 @@ partial void ProcessAuthorizeDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +371,8 @@ partial void ProcessAuthorizeDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -383,7 +435,11 @@ partial void ProcessAuthorizeDataSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -411,7 +467,11 @@ partial void ProcessAuthorizeDataSourceResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateConnector.g.cs index b96adc9..f5ab10e 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateConnector.g.cs @@ -85,6 +85,39 @@ partial void ProcessCreateConnectorResponseContent( public async global::System.Threading.Tasks.Task CreateConnectorAsync( global::System.Guid dataSourceId, + global::Mixedbread.DataSourceConnectorCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateConnectorAsResponseAsync( + dataSourceId: dataSourceId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a new connector
+ /// Create a new connector.
+ /// Args:
+ /// data_source_id: The ID of the data source to create a connector for.
+ /// params: The connector to create.
+ /// Returns:
+ /// The created connector. + ///
+ /// + /// The ID of the data source to create a connector for + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateConnectorAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.DataSourceConnectorCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,6 +153,7 @@ partial void ProcessCreateConnectorResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}/connectors", baseUri: ResolveBaseUri( @@ -202,6 +236,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessCreateConnectorResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessCreateConnectorResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessCreateConnectorResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessCreateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -393,9 +445,13 @@ partial void ProcessCreateConnectorResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSourceConnector.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSourceConnector.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -423,9 +479,13 @@ partial void ProcessCreateConnectorResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSourceConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSourceConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateDataSource.g.cs index e0ca9d6..aa9229f 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.CreateDataSource.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateDataSourceResponseContent( /// public async global::System.Threading.Tasks.Task CreateDataSourceAsync( + global::Mixedbread.AnyOf request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDataSourceAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a new data source
+ /// Create a new data source.
+ /// Args:
+ /// params: The data source to create.
+ /// Returns:
+ /// The created data source. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDataSourceAsResponseAsync( + global::Mixedbread.AnyOf request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -110,6 +137,7 @@ partial void ProcessCreateDataSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/data_sources/", baseUri: ResolveBaseUri( @@ -191,6 +219,8 @@ partial void ProcessCreateDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +231,11 @@ partial void ProcessCreateDataSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +253,8 @@ partial void ProcessCreateDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +264,7 @@ partial void ProcessCreateDataSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +273,11 @@ partial void ProcessCreateDataSourceResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +294,15 @@ partial void ProcessCreateDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +342,8 @@ partial void ProcessCreateDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +364,8 @@ partial void ProcessCreateDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -382,9 +428,13 @@ partial void ProcessCreateDataSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSource.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSource.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -412,9 +462,13 @@ partial void ProcessCreateDataSourceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSource.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSource.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteConnector.g.cs index 8775324..07814a5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteConnector.g.cs @@ -89,6 +89,39 @@ partial void ProcessDeleteConnectorResponseContent( global::System.Guid connectorId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteConnectorAsResponseAsync( + dataSourceId: dataSourceId, + connectorId: connectorId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a connector
+ /// Delete a connector.
+ /// Args:
+ /// data_source_id: The ID of the data source to delete a connector for.
+ /// connector_id: The ID of the connector to delete.
+ /// Returns:
+ /// The deleted connector. + ///
+ /// + /// The ID of the data source to delete a connector for + /// + /// + /// The ID of the connector to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteConnectorAsResponseAsync( + global::System.Guid dataSourceId, + global::System.Guid connectorId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +152,7 @@ partial void ProcessDeleteConnectorResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}/connectors/{connectorId}", baseUri: ResolveBaseUri( @@ -195,6 +229,8 @@ partial void ProcessDeleteConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +241,11 @@ partial void ProcessDeleteConnectorResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +263,8 @@ partial void ProcessDeleteConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +274,7 @@ partial void ProcessDeleteConnectorResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +283,11 @@ partial void ProcessDeleteConnectorResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +304,15 @@ partial void ProcessDeleteConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +352,8 @@ partial void ProcessDeleteConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +374,8 @@ partial void ProcessDeleteConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +438,13 @@ partial void ProcessDeleteConnectorResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSourceConnectorDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSourceConnectorDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +472,13 @@ partial void ProcessDeleteConnectorResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSourceConnectorDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSourceConnectorDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteDataSource.g.cs index 2ba62ed..446ac09 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.DeleteDataSource.g.cs @@ -80,6 +80,31 @@ partial void ProcessDeleteDataSourceResponseContent( global::System.Guid dataSourceId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteDataSourceAsResponseAsync( + dataSourceId: dataSourceId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a data source
+ /// Delete a data source.
+ /// Args:
+ /// data_source_id: The ID of the data source to delete. + ///
+ /// + /// The ID of the data source to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,6 +134,7 @@ partial void ProcessDeleteDataSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}", baseUri: ResolveBaseUri( @@ -184,6 +210,8 @@ partial void ProcessDeleteDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +222,11 @@ partial void ProcessDeleteDataSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +244,8 @@ partial void ProcessDeleteDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +255,7 @@ partial void ProcessDeleteDataSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +264,11 @@ partial void ProcessDeleteDataSourceResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +285,15 @@ partial void ProcessDeleteDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +333,8 @@ partial void ProcessDeleteDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +355,8 @@ partial void ProcessDeleteDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -375,9 +419,13 @@ partial void ProcessDeleteDataSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSourceDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSourceDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -405,9 +453,13 @@ partial void ProcessDeleteDataSourceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSourceDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSourceDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetConnector.g.cs index ac50d9d..1d1ac69 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetConnector.g.cs @@ -89,6 +89,39 @@ partial void ProcessGetConnectorResponseContent( global::System.Guid connectorId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConnectorAsResponseAsync( + dataSourceId: dataSourceId, + connectorId: connectorId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a connector by ID
+ /// Get a connector by ID.
+ /// Args:
+ /// data_source_id: The ID of the data source to get a connector for.
+ /// connector_id: The ID of the connector to get.
+ /// Returns:
+ /// The connector. + ///
+ /// + /// The ID of the data source to get a connector for + /// + /// + /// The ID of the connector to get + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetConnectorAsResponseAsync( + global::System.Guid dataSourceId, + global::System.Guid connectorId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +152,7 @@ partial void ProcessGetConnectorResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}/connectors/{connectorId}", baseUri: ResolveBaseUri( @@ -195,6 +229,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +241,11 @@ partial void ProcessGetConnectorResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +263,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +274,7 @@ partial void ProcessGetConnectorResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +283,11 @@ partial void ProcessGetConnectorResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +304,15 @@ partial void ProcessGetConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +352,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +374,8 @@ partial void ProcessGetConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +438,13 @@ partial void ProcessGetConnectorResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSourceConnector.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSourceConnector.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +472,13 @@ partial void ProcessGetConnectorResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSourceConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSourceConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetDataSource.g.cs index 6000a71..dd7a4c7 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.GetDataSource.g.cs @@ -82,6 +82,33 @@ partial void ProcessGetDataSourceResponseContent( global::System.Guid dataSourceId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDataSourceAsResponseAsync( + dataSourceId: dataSourceId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a data source by ID
+ /// Get a data source by ID.
+ /// Args:
+ /// data_source_id: The ID of the data source to fetch.
+ /// Returns:
+ /// The data source. + ///
+ /// + /// The ID of the data source to fetch + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessGetDataSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessGetDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessGetDataSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessGetDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessGetDataSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessGetDataSourceResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessGetDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessGetDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessGetDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessGetDataSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSource.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSource.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessGetDataSourceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSource.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSource.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListConnectors.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListConnectors.g.cs index 446cff1..8fc6db9 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListConnectors.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListConnectors.g.cs @@ -109,6 +109,56 @@ partial void ProcessListConnectorsResponseContent( bool? includeTotal = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListConnectorsAsResponseAsync( + dataSourceId: dataSourceId, + limit: limit, + after: after, + before: before, + includeTotal: includeTotal, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get all connectors for a data source
+ /// Get all connectors for a data source.
+ /// Args:
+ /// data_source_id: The ID of the data source to get connectors for.
+ /// pagination: The pagination options.
+ /// Returns:
+ /// The list of connectors. + ///
+ /// + /// The ID of the data source to get connectors for + /// + /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListConnectorsAsResponseAsync( + global::System.Guid dataSourceId, + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -142,16 +192,17 @@ partial void ProcessListConnectorsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}/connectors", baseUri: ResolveBaseUri( servers: s_ListConnectorsServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) .AddOptionalParameter("before", before) - .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -227,6 +278,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -237,6 +290,11 @@ partial void ProcessListConnectorsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -254,6 +312,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -263,8 +323,7 @@ partial void ProcessListConnectorsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +332,11 @@ partial void ProcessListConnectorsResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -289,14 +353,15 @@ partial void ProcessListConnectorsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -336,6 +401,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -356,6 +423,8 @@ partial void ProcessListConnectorsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -418,9 +487,13 @@ partial void ProcessListConnectorsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ConnectorListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ConnectorListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -448,9 +521,13 @@ partial void ProcessListConnectorsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ConnectorListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ConnectorListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListDataSources.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListDataSources.g.cs index d59551d..784d133 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListDataSources.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.ListDataSources.g.cs @@ -100,6 +100,48 @@ partial void ProcessListDataSourcesResponseContent( bool? includeTotal = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDataSourcesAsResponseAsync( + limit: limit, + after: after, + before: before, + includeTotal: includeTotal, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get all data sources
+ /// Get all data sources.
+ /// Returns:
+ /// The list of data sources. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListDataSourcesAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -132,16 +174,17 @@ partial void ProcessListDataSourcesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/data_sources/", baseUri: ResolveBaseUri( servers: s_ListDataSourcesServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) .AddOptionalParameter("before", before) - .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +259,8 @@ partial void ProcessListDataSourcesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +271,11 @@ partial void ProcessListDataSourcesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +293,8 @@ partial void ProcessListDataSourcesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +304,7 @@ partial void ProcessListDataSourcesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +313,11 @@ partial void ProcessListDataSourcesResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +334,15 @@ partial void ProcessListDataSourcesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +382,8 @@ partial void ProcessListDataSourcesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +404,8 @@ partial void ProcessListDataSourcesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -407,9 +468,13 @@ partial void ProcessListDataSourcesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSourceListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSourceListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -437,9 +502,13 @@ partial void ProcessListDataSourcesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSourceListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSourceListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Oauth2Callback.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Oauth2Callback.g.cs index 7cae780..dbf887c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Oauth2Callback.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.Oauth2Callback.g.cs @@ -104,6 +104,55 @@ partial void ProcessOauth2CallbackResponse( string? errorDescription = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await Oauth2CallbackAsResponseAsync( + state: state, + code: code, + error: error, + errorDescription: errorDescription, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// OAuth2 callback for data source authorization
+ /// OAuth2 callback endpoint for completing data source authorization.
+ /// This endpoint is called by OAuth2 providers after user authorization.
+ /// It exchanges the authorization code for access tokens and stores them
+ /// securely for the data source.
+ /// Args:
+ /// state: OAuth2 state parameter used for CSRF protection
+ /// code: Authorization code from the OAuth2 provider
+ /// error: OAuth2 error code if authorization was denied or failed
+ /// error_description: Human-readable description of the error
+ /// Returns:
+ /// Redirect to the data source details page on success
+ /// Raises:
+ /// OAuth2TokenExchangeError: When OAuth2 provider returns an error
+ /// InvalidStateError: When state parameter is invalid or expired + ///
+ /// + /// OAuth2 state parameter for CSRF protection + /// + /// + /// Authorization code from OAuth2 provider + /// + /// + /// OAuth2 error code if authorization failed + /// + /// + /// Human-readable error description + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task Oauth2CallbackAsResponseAsync( + string state, + string code, + string? error = default, + string? errorDescription = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -136,16 +185,17 @@ partial void ProcessOauth2CallbackResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/data_sources/oauth2/callback", baseUri: ResolveBaseUri( servers: s_Oauth2CallbackServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddRequiredParameter("state", state) .AddRequiredParameter("code", code) .AddOptionalParameter("error", error) - .AddOptionalParameter("error_description", errorDescription) + .AddOptionalParameter("error_description", errorDescription) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -220,6 +270,8 @@ partial void ProcessOauth2CallbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -230,6 +282,11 @@ partial void ProcessOauth2CallbackResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -247,6 +304,8 @@ partial void ProcessOauth2CallbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -256,8 +315,7 @@ partial void ProcessOauth2CallbackResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -266,6 +324,11 @@ partial void ProcessOauth2CallbackResponse( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -282,14 +345,15 @@ partial void ProcessOauth2CallbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -329,6 +393,8 @@ partial void ProcessOauth2CallbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -349,6 +415,8 @@ partial void ProcessOauth2CallbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Successful authorization, redirect to data source @@ -511,6 +579,10 @@ partial void ProcessOauth2CallbackResponse( { __response.EnsureSuccessStatusCode(); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -532,6 +604,10 @@ partial void ProcessOauth2CallbackResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateConnector.g.cs index 0d313d0..13dc110 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateConnector.g.cs @@ -92,6 +92,45 @@ partial void ProcessUpdateConnectorResponseContent( global::System.Guid dataSourceId, global::System.Guid connectorId, + global::Mixedbread.DataSourceConnectorUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateConnectorAsResponseAsync( + dataSourceId: dataSourceId, + connectorId: connectorId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a connector
+ /// Update a connector.
+ /// Args:
+ /// data_source_id: The ID of the data source to update a connector for.
+ /// connector_id: The ID of the connector to update.
+ /// params: The connector to update.
+ /// Returns:
+ /// The updated connector. + ///
+ /// + /// The ID of the data source to update a connector for + /// + /// + /// The ID of the connector to update + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateConnectorAsResponseAsync( + global::System.Guid dataSourceId, + global::System.Guid connectorId, + global::Mixedbread.DataSourceConnectorUpdateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -128,6 +167,7 @@ partial void ProcessUpdateConnectorResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}/connectors/{connectorId}", baseUri: ResolveBaseUri( @@ -211,6 +251,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +263,11 @@ partial void ProcessUpdateConnectorResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +285,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +296,7 @@ partial void ProcessUpdateConnectorResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +305,11 @@ partial void ProcessUpdateConnectorResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +326,15 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +374,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +396,8 @@ partial void ProcessUpdateConnectorResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -402,9 +460,13 @@ partial void ProcessUpdateConnectorResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSourceConnector.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSourceConnector.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -432,9 +494,13 @@ partial void ProcessUpdateConnectorResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSourceConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSourceConnector.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateDataSource.g.cs index 5c7bd17..d41d9f8 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.UpdateDataSource.g.cs @@ -85,6 +85,39 @@ partial void ProcessUpdateDataSourceResponseContent( public async global::System.Threading.Tasks.Task UpdateDataSourceAsync( global::System.Guid dataSourceId, + global::Mixedbread.AnyOf request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateDataSourceAsResponseAsync( + dataSourceId: dataSourceId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a data source
+ /// Update a data source.
+ /// Args:
+ /// data_source_id: The ID of the data source to update.
+ /// params: The data source to update.
+ /// Returns:
+ /// The updated data source. + ///
+ /// + /// The ID of the data source to update + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.AnyOf request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -118,6 +151,7 @@ partial void ProcessUpdateDataSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/data_sources/{dataSourceId}", baseUri: ResolveBaseUri( @@ -200,6 +234,8 @@ partial void ProcessUpdateDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -210,6 +246,11 @@ partial void ProcessUpdateDataSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -227,6 +268,8 @@ partial void ProcessUpdateDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -236,8 +279,7 @@ partial void ProcessUpdateDataSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -246,6 +288,11 @@ partial void ProcessUpdateDataSourceResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -262,14 +309,15 @@ partial void ProcessUpdateDataSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +357,8 @@ partial void ProcessUpdateDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -329,6 +379,8 @@ partial void ProcessUpdateDataSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -391,9 +443,13 @@ partial void ProcessUpdateDataSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.DataSource.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.DataSource.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -421,9 +477,13 @@ partial void ProcessUpdateDataSourceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.DataSource.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.DataSource.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs index 0bff0bb..d5187de 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.DataSourcesClient.g.cs @@ -113,10 +113,10 @@ public DataSourcesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public DataSourcesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateExtractionJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateExtractionJob.g.cs index f642916..9f18f25 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateExtractionJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateExtractionJob.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateExtractionJobResponseContent( /// public async global::System.Threading.Tasks.Task CreateExtractionJobAsync( + global::Mixedbread.ExtractJobCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateExtractionJobAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Start an extraction job
+ /// Start an extraction job for the provided file and schema.
+ /// Args:
+ /// params: The parameters for creating an extraction job.
+ /// Returns:
+ /// The created extraction job. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateExtractionJobAsResponseAsync( + global::Mixedbread.ExtractJobCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessCreateExtractionJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/extractions/jobs", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessCreateExtractionJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessCreateExtractionJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessCreateExtractionJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessCreateExtractionJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessCreateExtractionJobResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessCreateExtractionJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessCreateExtractionJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessCreateExtractionJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessCreateExtractionJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ExtractionJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ExtractionJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessCreateExtractionJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ExtractionJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ExtractionJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateSchema.g.cs index ae6c714..4ecad71 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.CreateSchema.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateSchemaResponseContent( /// public async global::System.Threading.Tasks.Task CreateSchemaAsync( + global::Mixedbread.JsonSchemaCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateSchemaAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a schema
+ /// Create a schema with the provided parameters.
+ /// Args:
+ /// params: The parameters for creating a schema.
+ /// Returns:
+ /// The created schema. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateSchemaAsResponseAsync( + global::Mixedbread.JsonSchemaCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessCreateSchemaResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/extractions/schema", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessCreateSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessCreateSchemaResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessCreateSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessCreateSchemaResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessCreateSchemaResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessCreateSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessCreateSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessCreateSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessCreateSchemaResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.CreatedJsonSchema.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.CreatedJsonSchema.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessCreateSchemaResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.CreatedJsonSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.CreatedJsonSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.EnhanceSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.EnhanceSchema.g.cs index b5c93ae..c3ed4c0 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.EnhanceSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.EnhanceSchema.g.cs @@ -78,6 +78,33 @@ partial void ProcessEnhanceSchemaResponseContent( /// public async global::System.Threading.Tasks.Task EnhanceSchemaAsync( + global::Mixedbread.JsonSchemaEnhanceParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EnhanceSchemaAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Enhance a schema
+ /// Enhance a schema by enriching the descriptions to aid extraction.
+ /// Args:
+ /// params: The parameters for enhancing a schema.
+ /// Returns:
+ /// The enhanced schema. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EnhanceSchemaAsResponseAsync( + global::Mixedbread.JsonSchemaEnhanceParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessEnhanceSchemaResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/extractions/schema/enhance", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessEnhanceSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessEnhanceSchemaResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessEnhanceSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessEnhanceSchemaResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessEnhanceSchemaResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessEnhanceSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessEnhanceSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessEnhanceSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessEnhanceSchemaResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.EnhancedJsonSchema.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.EnhancedJsonSchema.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessEnhanceSchemaResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.EnhancedJsonSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.EnhancedJsonSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ExtractContent.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ExtractContent.g.cs index fa5131a..bab3c75 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ExtractContent.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ExtractContent.g.cs @@ -78,6 +78,33 @@ partial void ProcessExtractContentResponseContent( /// public async global::System.Threading.Tasks.Task ExtractContentAsync( + global::Mixedbread.ExtractContentCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExtractContentAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Extract content from a string
+ /// Extract content from a string using the provided schema.
+ /// Args:
+ /// params: The parameters for extracting content from a string.
+ /// Returns:
+ /// The extracted content. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ExtractContentAsResponseAsync( + global::Mixedbread.ExtractContentCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessExtractContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/extractions/content", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessExtractContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessExtractContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessExtractContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessExtractContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessExtractContentResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessExtractContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessExtractContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessExtractContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessExtractContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ExtractionResult.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ExtractionResult.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessExtractContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ExtractionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ExtractionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.RetrieveExtractionJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.RetrieveExtractionJob.g.cs index 3eeec7f..8725fde 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.RetrieveExtractionJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.RetrieveExtractionJob.g.cs @@ -82,6 +82,33 @@ partial void ProcessRetrieveExtractionJobResponseContent( string jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveExtractionJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get extraction job result
+ /// Get detailed information about a specific extraction job.
+ /// Args:
+ /// job_id: The ID of the extraction job.
+ /// Returns:
+ /// Detailed information about the extraction job. + ///
+ /// + /// The ID of the extraction job to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveExtractionJobAsResponseAsync( + string jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessRetrieveExtractionJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/extractions/jobs/{jobId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessRetrieveExtractionJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessRetrieveExtractionJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessRetrieveExtractionJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessRetrieveExtractionJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessRetrieveExtractionJobResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessRetrieveExtractionJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessRetrieveExtractionJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessRetrieveExtractionJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessRetrieveExtractionJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ExtractionJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ExtractionJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessRetrieveExtractionJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ExtractionJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ExtractionJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ValidateSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ValidateSchema.g.cs index 2c4466b..4ceea4e 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ValidateSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.ValidateSchema.g.cs @@ -78,6 +78,33 @@ partial void ProcessValidateSchemaResponseContent( /// public async global::System.Threading.Tasks.Task ValidateSchemaAsync( + global::Mixedbread.JsonSchemaValidateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ValidateSchemaAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Validate a schema
+ /// Validate a schema.
+ /// Args:
+ /// params: The parameters for validating a schema.
+ /// Returns:
+ /// The validation result. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ValidateSchemaAsResponseAsync( + global::Mixedbread.JsonSchemaValidateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessValidateSchemaResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/extractions/schema/validate", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessValidateSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessValidateSchemaResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessValidateSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessValidateSchemaResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessValidateSchemaResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessValidateSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessValidateSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessValidateSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessValidateSchemaResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ValidatedJsonSchema.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ValidatedJsonSchema.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessValidateSchemaResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ValidatedJsonSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ValidatedJsonSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs index e98bb89..4692536 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ExtractionsClient.g.cs @@ -113,10 +113,10 @@ public ExtractionsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ExtractionsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.AbortMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.AbortMultipartUpload.g.cs index f3cb4b9..2dd8be2 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.AbortMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.AbortMultipartUpload.g.cs @@ -78,6 +78,29 @@ partial void ProcessAbortMultipartUploadResponseContent( global::System.Guid uploadId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AbortMultipartUploadAsResponseAsync( + uploadId: uploadId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Abort multipart upload
+ /// Abort a multipart upload and clean up any uploaded parts. + ///
+ /// + /// The ID of the multipart upload to abort + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AbortMultipartUploadAsResponseAsync( + global::System.Guid uploadId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -107,6 +130,7 @@ partial void ProcessAbortMultipartUploadResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/files/uploads/{uploadId}/abort", baseUri: ResolveBaseUri( @@ -182,6 +206,8 @@ partial void ProcessAbortMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +218,11 @@ partial void ProcessAbortMultipartUploadResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +240,8 @@ partial void ProcessAbortMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +251,7 @@ partial void ProcessAbortMultipartUploadResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +260,11 @@ partial void ProcessAbortMultipartUploadResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +281,15 @@ partial void ProcessAbortMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +329,8 @@ partial void ProcessAbortMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +351,8 @@ partial void ProcessAbortMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -373,9 +415,13 @@ partial void ProcessAbortMultipartUploadResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.FileDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.FileDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -403,9 +449,13 @@ partial void ProcessAbortMultipartUploadResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.FileDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.FileDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CompleteMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CompleteMultipartUpload.g.cs index 7088627..71650ca 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CompleteMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CompleteMultipartUpload.g.cs @@ -81,6 +81,35 @@ partial void ProcessCompleteMultipartUploadResponseContent( public async global::System.Threading.Tasks.Task CompleteMultipartUploadAsync( global::System.Guid uploadId, + global::Mixedbread.CompleteMultipartUploadRequest request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CompleteMultipartUploadAsResponseAsync( + uploadId: uploadId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Complete multipart upload
+ /// Complete a multipart upload after all parts have been uploaded.
+ /// Creates the file object and returns it. + ///
+ /// + /// The ID of the multipart upload + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CompleteMultipartUploadAsResponseAsync( + global::System.Guid uploadId, + global::Mixedbread.CompleteMultipartUploadRequest request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -116,6 +145,7 @@ partial void ProcessCompleteMultipartUploadResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/files/uploads/{uploadId}/complete", baseUri: ResolveBaseUri( @@ -198,6 +228,8 @@ partial void ProcessCompleteMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -208,6 +240,11 @@ partial void ProcessCompleteMultipartUploadResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -225,6 +262,8 @@ partial void ProcessCompleteMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -234,8 +273,7 @@ partial void ProcessCompleteMultipartUploadResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +282,11 @@ partial void ProcessCompleteMultipartUploadResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -260,14 +303,15 @@ partial void ProcessCompleteMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -307,6 +351,8 @@ partial void ProcessCompleteMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -327,6 +373,8 @@ partial void ProcessCompleteMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -389,9 +437,13 @@ partial void ProcessCompleteMultipartUploadResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -419,9 +471,13 @@ partial void ProcessCompleteMultipartUploadResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateFile.g.cs index a26ae27..9d49d33 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateFile.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateFileResponseContent( /// public async global::System.Threading.Tasks.Task CreateFileAsync( + global::Mixedbread.BodyCreateFile request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateFileAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload file
+ /// Upload a new file.
+ /// Args:
+ /// file: The file to upload.
+ /// Returns:
+ /// FileResponse: The response containing the details of the uploaded file. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateFileAsResponseAsync( + global::Mixedbread.BodyCreateFile request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,10 +135,11 @@ partial void ProcessCreateFileResponseContent( var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/files", baseUri: ResolveBaseUri( @@ -146,6 +174,7 @@ partial void ProcessCreateFileResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -184,7 +213,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -226,6 +257,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -236,6 +269,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -253,6 +291,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -262,8 +302,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +311,11 @@ request.Filename is null __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -288,14 +332,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -335,6 +380,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -355,6 +402,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -417,9 +466,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -447,9 +500,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -521,5 +578,924 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload file
+ /// Upload a new file.
+ /// Args:
+ /// file: The file to upload.
+ /// Returns:
+ /// FileResponse: The response containing the details of the uploaded file. + ///
+ /// + /// The file to upload + /// + /// + /// The file to upload + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateFileAsync( + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Mixedbread.BodyCreateFile + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateFileArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Mixedbread.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateFileSecurityRequirements, + operationName: "CreateFileAsync"); + + using var __timeoutCancellationTokenSource = global::Mixedbread.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Mixedbread.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mixedbread.PathBuilder( + path: "/v1/files", + baseUri: ResolveBaseUri( + servers: s_CreateFileServers, + defaultBaseUrl: "https://api.mixedbread.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Mixedbread.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Mixedbread.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upload file
+ /// Upload a new file.
+ /// Args:
+ /// file: The file to upload.
+ /// Returns:
+ /// FileResponse: The response containing the details of the uploaded file. + ///
+ /// + /// The file to upload + /// + /// + /// The file to upload + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateFileAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Mixedbread.BodyCreateFile + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateFileArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Mixedbread.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateFileSecurityRequirements, + operationName: "CreateFileAsync"); + + using var __timeoutCancellationTokenSource = global::Mixedbread.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Mixedbread.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mixedbread.PathBuilder( + path: "/v1/files", + baseUri: ResolveBaseUri( + servers: s_CreateFileServers, + defaultBaseUrl: "https://api.mixedbread.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateFile", + methodName: "CreateFileAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Mixedbread.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Mixedbread.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateMultipartUpload.g.cs index 03fc4a0..7b4e777 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.CreateMultipartUpload.g.cs @@ -74,6 +74,29 @@ partial void ProcessCreateMultipartUploadResponseContent( /// public async global::System.Threading.Tasks.Task CreateMultipartUploadAsync( + global::Mixedbread.CreateMultipartUploadRequest request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateMultipartUploadAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create multipart upload
+ /// Initiate a multipart upload and receive presigned URLs for uploading parts directly to storage. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateMultipartUploadAsResponseAsync( + global::Mixedbread.CreateMultipartUploadRequest request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +131,7 @@ partial void ProcessCreateMultipartUploadResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/files/uploads", baseUri: ResolveBaseUri( @@ -189,6 +213,8 @@ partial void ProcessCreateMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -199,6 +225,11 @@ partial void ProcessCreateMultipartUploadResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -216,6 +247,8 @@ partial void ProcessCreateMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -225,8 +258,7 @@ partial void ProcessCreateMultipartUploadResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -235,6 +267,11 @@ partial void ProcessCreateMultipartUploadResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -251,14 +288,15 @@ partial void ProcessCreateMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -298,6 +336,8 @@ partial void ProcessCreateMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -318,6 +358,8 @@ partial void ProcessCreateMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -380,9 +422,13 @@ partial void ProcessCreateMultipartUploadResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.CreateMultipartUploadResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.CreateMultipartUploadResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -410,9 +456,13 @@ partial void ProcessCreateMultipartUploadResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.CreateMultipartUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.CreateMultipartUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DeleteFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DeleteFile.g.cs index d866637..bc52f1c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DeleteFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DeleteFile.g.cs @@ -82,6 +82,33 @@ partial void ProcessDeleteFileResponseContent( global::System.Guid fileId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete file
+ /// Delete a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to delete.
+ /// Returns:
+ /// FileDeleted: The response containing the details of the deleted file. + ///
+ /// + /// The ID of the file to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteFileAsResponseAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessDeleteFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/files/{fileId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessDeleteFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessDeleteFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessDeleteFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessDeleteFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessDeleteFileResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessDeleteFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessDeleteFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessDeleteFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessDeleteFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.FileDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.FileDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessDeleteFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.FileDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.FileDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DownloadFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DownloadFile.g.cs index 695b9f1..70386a5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DownloadFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.DownloadFile.g.cs @@ -82,6 +82,33 @@ partial void ProcessDownloadFileResponseContent( global::System.Guid fileId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DownloadFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Download file
+ /// Download a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to download.
+ /// Returns:
+ /// FileStreamResponse: The response containing the file to be downloaded. + ///
+ /// + /// The ID of the file to download + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DownloadFileAsStreamAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessDownloadFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/files/{fileId}/content", baseUri: ResolveBaseUri( @@ -186,16 +214,23 @@ partial void ProcessDownloadFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { __response = await HttpClient.SendAsync( request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessDownloadFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessDownloadFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessDownloadFileResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,378 @@ partial void ProcessDownloadFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + try + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDownloadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Mixedbread.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Mixedbread.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + try + { + __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::Mixedbread.ResponseStream(__response, __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + } + catch + { + __response.Dispose(); + throw; + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Download file
+ /// Download a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to download.
+ /// Returns:
+ /// FileStreamResponse: The response containing the file to be downloaded. + ///
+ /// + /// The ID of the file to download + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DownloadFileAsResponseAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDownloadFileArguments( + httpClient: HttpClient, + fileId: ref fileId); + + + var __authorizations = global::Mixedbread.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DownloadFileSecurityRequirements, + operationName: "DownloadFileAsync"); + + using var __timeoutCancellationTokenSource = global::Mixedbread.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Mixedbread.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mixedbread.PathBuilder( + path: $"/v1/files/{fileId}/content", + baseUri: ResolveBaseUri( + servers: s_DownloadFileServers, + defaultBaseUrl: "https://api.mixedbread.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDownloadFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( clientOptions: Options, requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +700,8 @@ partial void ProcessDownloadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +722,8 @@ partial void ProcessDownloadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -373,7 +782,11 @@ partial void ProcessDownloadFileResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -400,7 +813,11 @@ partial void ProcessDownloadFileResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.GetMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.GetMultipartUpload.g.cs index c95d61e..5de0dc5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.GetMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.GetMultipartUpload.g.cs @@ -78,6 +78,29 @@ partial void ProcessGetMultipartUploadResponseContent( global::System.Guid uploadId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetMultipartUploadAsResponseAsync( + uploadId: uploadId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get multipart upload details
+ /// Get a multipart upload's details with fresh presigned URLs for any parts not yet uploaded. + ///
+ /// + /// The ID of the multipart upload + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetMultipartUploadAsResponseAsync( + global::System.Guid uploadId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -107,6 +130,7 @@ partial void ProcessGetMultipartUploadResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/files/uploads/{uploadId}", baseUri: ResolveBaseUri( @@ -182,6 +206,8 @@ partial void ProcessGetMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +218,11 @@ partial void ProcessGetMultipartUploadResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +240,8 @@ partial void ProcessGetMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +251,7 @@ partial void ProcessGetMultipartUploadResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +260,11 @@ partial void ProcessGetMultipartUploadResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +281,15 @@ partial void ProcessGetMultipartUploadResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +329,8 @@ partial void ProcessGetMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +351,8 @@ partial void ProcessGetMultipartUploadResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -373,9 +415,13 @@ partial void ProcessGetMultipartUploadResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MultipartUploadDetailResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MultipartUploadDetailResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -403,9 +449,13 @@ partial void ProcessGetMultipartUploadResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MultipartUploadDetailResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MultipartUploadDetailResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListFiles.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListFiles.g.cs index 78c46f4..8555a79 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListFiles.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListFiles.g.cs @@ -108,6 +108,55 @@ partial void ProcessListFilesResponseContent( string? q = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFilesAsResponseAsync( + limit: limit, + after: after, + before: before, + includeTotal: includeTotal, + q: q, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List files
+ /// List all files for the authenticated user.
+ /// Args:
+ /// pagination: The pagination options
+ /// Returns:
+ /// A list of files belonging to the user. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Search query for fuzzy matching over name and description fields + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListFilesAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + string? q = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -141,17 +190,18 @@ partial void ProcessListFilesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/files", baseUri: ResolveBaseUri( servers: s_ListFilesServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) .AddOptionalParameter("before", before) .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) - .AddOptionalParameter("q", q) + .AddOptionalParameter("q", q) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -227,6 +277,8 @@ partial void ProcessListFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -237,6 +289,11 @@ partial void ProcessListFilesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -254,6 +311,8 @@ partial void ProcessListFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -263,8 +322,7 @@ partial void ProcessListFilesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +331,11 @@ partial void ProcessListFilesResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -289,14 +352,15 @@ partial void ProcessListFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -336,6 +400,8 @@ partial void ProcessListFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -356,6 +422,8 @@ partial void ProcessListFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -418,9 +486,13 @@ partial void ProcessListFilesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.FileListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.FileListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -448,9 +520,13 @@ partial void ProcessListFilesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.FileListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.FileListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListMultipartUploads.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListMultipartUploads.g.cs index 797647e..baa0413 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListMultipartUploads.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.ListMultipartUploads.g.cs @@ -72,6 +72,24 @@ partial void ProcessListMultipartUploadsResponseContent( public async global::System.Threading.Tasks.Task ListMultipartUploadsAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMultipartUploadsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List in-progress multipart uploads
+ /// List all in-progress multipart uploads for the authenticated organization. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListMultipartUploadsAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +118,7 @@ partial void ProcessListMultipartUploadsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/files/uploads", baseUri: ResolveBaseUri( @@ -174,6 +193,8 @@ partial void ProcessListMultipartUploadsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +205,11 @@ partial void ProcessListMultipartUploadsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -201,6 +227,8 @@ partial void ProcessListMultipartUploadsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +238,7 @@ partial void ProcessListMultipartUploadsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +247,11 @@ partial void ProcessListMultipartUploadsResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -236,14 +268,15 @@ partial void ProcessListMultipartUploadsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -283,6 +316,8 @@ partial void ProcessListMultipartUploadsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +338,8 @@ partial void ProcessListMultipartUploadsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -327,9 +364,13 @@ partial void ProcessListMultipartUploadsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MultipartUploadListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MultipartUploadListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -357,9 +398,13 @@ partial void ProcessListMultipartUploadsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MultipartUploadListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MultipartUploadListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.RetrieveFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.RetrieveFile.g.cs index 28ad4dc..688c845 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.RetrieveFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.RetrieveFile.g.cs @@ -82,6 +82,33 @@ partial void ProcessRetrieveFileResponseContent( global::System.Guid fileId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get file details
+ /// Retrieve details of a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to retrieve.
+ /// Returns:
+ /// FileResponse: The response containing the file details. + ///
+ /// + /// The ID of the file to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveFileAsResponseAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessRetrieveFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/files/{fileId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessRetrieveFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessRetrieveFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessRetrieveFileResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessRetrieveFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessRetrieveFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.UpdateFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.UpdateFile.g.cs index f59f676..7eb08b5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.UpdateFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.UpdateFile.g.cs @@ -85,6 +85,39 @@ partial void ProcessUpdateFileResponseContent( public async global::System.Threading.Tasks.Task UpdateFileAsync( global::System.Guid fileId, + global::Mixedbread.BodyUpdateFile request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateFileAsResponseAsync( + fileId: fileId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update file
+ /// Update the details of a specific file.
+ /// Args:
+ /// file_id: The ID of the file to update.
+ /// file: The new details for the file.
+ /// Returns:
+ /// FileObject: The updated file details. + ///
+ /// + /// The ID of the file to update + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateFileAsResponseAsync( + global::System.Guid fileId, + global::Mixedbread.BodyUpdateFile request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -116,10 +149,11 @@ partial void ProcessUpdateFileResponseContent( var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/files/{fileId}", baseUri: ResolveBaseUri( @@ -154,10 +188,12 @@ partial void ProcessUpdateFileResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(fileId.ToString() ?? string.Empty), name: "\"file_id\""); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( request.Filename is null @@ -195,7 +231,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -238,6 +276,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -248,6 +288,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -265,6 +310,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -274,8 +321,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +330,11 @@ request.Filename is null __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -300,14 +351,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -347,6 +399,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -367,6 +421,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -429,9 +485,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -459,9 +519,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,5 +603,946 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Update file
+ /// Update the details of a specific file.
+ /// Args:
+ /// file_id: The ID of the file to update.
+ /// file: The new details for the file.
+ /// Returns:
+ /// FileObject: The updated file details. + ///
+ /// + /// The ID of the file to update + /// + /// + /// The file to update + /// + /// + /// The file to update + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UpdateFileAsync( + global::System.Guid fileId, + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Mixedbread.BodyUpdateFile + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareUpdateFileArguments( + httpClient: HttpClient, + fileId: ref fileId, + request: request); + + + var __authorizations = global::Mixedbread.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateFileSecurityRequirements, + operationName: "UpdateFileAsync"); + + using var __timeoutCancellationTokenSource = global::Mixedbread.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Mixedbread.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mixedbread.PathBuilder( + path: $"/v1/files/{fileId}", + baseUri: ResolveBaseUri( + servers: s_UpdateFileServers, + defaultBaseUrl: "https://api.mixedbread.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(fileId.ToString() ?? string.Empty), + name: "\"file_id\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Mixedbread.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Mixedbread.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update file
+ /// Update the details of a specific file.
+ /// Args:
+ /// file_id: The ID of the file to update.
+ /// file: The new details for the file.
+ /// Returns:
+ /// FileObject: The updated file details. + ///
+ /// + /// The ID of the file to update + /// + /// + /// The file to update + /// + /// + /// The file to update + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateFileAsResponseAsync( + global::System.Guid fileId, + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Mixedbread.BodyUpdateFile + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareUpdateFileArguments( + httpClient: HttpClient, + fileId: ref fileId, + request: request); + + + var __authorizations = global::Mixedbread.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateFileSecurityRequirements, + operationName: "UpdateFileAsync"); + + using var __timeoutCancellationTokenSource = global::Mixedbread.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Mixedbread.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mixedbread.PathBuilder( + path: $"/v1/files/{fileId}", + baseUri: ResolveBaseUri( + servers: s_UpdateFileServers, + defaultBaseUrl: "https://api.mixedbread.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(fileId.ToString() ?? string.Empty), + name: "\"file_id\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateFile", + methodName: "UpdateFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Mixedbread.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Mixedbread.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Mixedbread.FileObject.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Mixedbread.FileObject.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ 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 8e2959a..ed9518f 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.FilesClient.g.cs @@ -113,10 +113,10 @@ public FilesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FilesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IAdminClient.ReingestAllStores.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IAdminClient.ReingestAllStores.g.cs index 6557b59..7f55bf4 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IAdminClient.ReingestAllStores.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IAdminClient.ReingestAllStores.g.cs @@ -30,5 +30,31 @@ public partial interface IAdminClient bool? billable = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reingest all stores
+ /// Reingest all stores across all organizations (admin only).
+ /// This endpoint creates StoreFileReingestionJob for each store.
+ /// Returns:
+ /// dict: Confirmation message with count of jobs created. + ///
+ /// + /// + /// + /// Statuses of files to reingest + /// + /// + /// Whether the reingestion is billable to the user
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReingestAllStoresAsResponseAsync( + global::System.Guid organizationId, + string storeIdentifier, + global::System.Collections.Generic.IList? statuses = default, + bool? billable = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.CreateApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.CreateApiKey.g.cs index 4c2b6e9..5c35ec4 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.CreateApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.CreateApiKey.g.cs @@ -29,6 +29,23 @@ public partial interface IApiKeysClient /// Returns:
/// ApiKeyCreated: The response containing the details of the created API key. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateApiKeyAsResponseAsync( + + global::Mixedbread.ApiKeyCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create API key
+ /// Create a new API key.
+ /// Args:
+ /// params: The parameters for creating the API key.
+ /// Returns:
+ /// ApiKeyCreated: The response containing the details of the created API key. + ///
/// /// A name/description for the API key
/// Default Value: API Key diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.DeleteApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.DeleteApiKey.g.cs index 0eb360c..923ffaf 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.DeleteApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.DeleteApiKey.g.cs @@ -22,5 +22,23 @@ public partial interface IApiKeysClient global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete API key
+ /// Delete a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to delete.
+ /// Returns:
+ /// ApiKeyDeleted: The response containing the details of the deleted API key. + ///
+ /// + /// The ID of the API key to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.ListApiKeys.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.ListApiKeys.g.cs index 3fe7647..76aecd5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.ListApiKeys.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.ListApiKeys.g.cs @@ -28,5 +28,29 @@ public partial interface IApiKeysClient int? offset = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List API keys
+ /// List all API keys for the authenticated user.
+ /// Args:
+ /// pagination: The pagination options
+ /// Returns:
+ /// A list of API keys belonging to the user. + ///
+ /// + /// Maximum number of items to return per page
+ /// Default Value: 100 + /// + /// + /// Offset of the first item to return
+ /// Default Value: 0 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListApiKeysAsResponseAsync( + int? limit = default, + int? offset = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RerollApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RerollApiKey.g.cs index 22d9a65..14e3100 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RerollApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RerollApiKey.g.cs @@ -23,5 +23,24 @@ public partial interface IApiKeysClient global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reroll API key
+ /// Reroll the secret for a specific API key by its ID.
+ /// This generates a new secret key, invalidating the old one.
+ /// Args:
+ /// api_key_id: The ID of the API key to reroll.
+ /// Returns:
+ /// ApiKeyCreated: The response containing the API key details with the new secret key. + ///
+ /// + /// The ID of the API key to reroll + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RerollApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RetrieveApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RetrieveApiKey.g.cs index e7923c3..046955d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RetrieveApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RetrieveApiKey.g.cs @@ -22,5 +22,23 @@ public partial interface IApiKeysClient global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get API key details
+ /// Retrieve details of a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to retrieve.
+ /// Returns:
+ /// ApiKey: The response containing the API key details. + ///
+ /// + /// The ID of the API key to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RevokeApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RevokeApiKey.g.cs index 901e9ad..583e03a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RevokeApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.RevokeApiKey.g.cs @@ -22,5 +22,23 @@ public partial interface IApiKeysClient global::System.Guid apiKeyId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Revoke API key
+ /// Revoke a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to revoke.
+ /// Returns:
+ /// ApiKey: The response containing the details of the revoked API key. + ///
+ /// + /// The ID of the API key to revoke + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RevokeApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.UpdateApiKey.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.UpdateApiKey.g.cs index b41c74b..c26414f 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.UpdateApiKey.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IApiKeysClient.UpdateApiKey.g.cs @@ -38,6 +38,28 @@ public partial interface IApiKeysClient /// /// The ID of the API key to update /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateApiKeyAsResponseAsync( + global::System.Guid apiKeyId, + + global::Mixedbread.ApiKeyUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update API key
+ /// Update a specific API key by its ID.
+ /// Args:
+ /// api_key_id: The ID of the API key to update.
+ /// params: The parameters to update.
+ /// Returns:
+ /// ApiKey: The updated API key details. + ///
+ /// + /// The ID of the API key to update + /// /// /// A name/description for the API key /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetBillingSummary.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetBillingSummary.g.cs index a3207ff..5a1d00d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetBillingSummary.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetBillingSummary.g.cs @@ -13,5 +13,14 @@ public partial interface IBillingClient global::System.Threading.Tasks.Task GetBillingSummaryAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get billing summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetBillingSummaryAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetParsingCostHistogram.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetParsingCostHistogram.g.cs index 0bd7f56..dd37717 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetParsingCostHistogram.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetParsingCostHistogram.g.cs @@ -13,5 +13,14 @@ public partial interface IBillingClient global::System.Threading.Tasks.Task GetParsingCostHistogramAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get parsing cost histogram + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetParsingCostHistogramAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetStoreCostHistogram.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetStoreCostHistogram.g.cs index 05e85df..823ddc2 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetStoreCostHistogram.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.GetStoreCostHistogram.g.cs @@ -17,5 +17,18 @@ public partial interface IBillingClient global::System.Guid storeId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get store cost histogram + /// + /// + /// The ID of the store + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetStoreCostHistogramAsResponseAsync( + global::System.Guid storeId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.ListStoreCostInfo.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.ListStoreCostInfo.g.cs index bf4691c..bf56aa5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.ListStoreCostInfo.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IBillingClient.ListStoreCostInfo.g.cs @@ -13,5 +13,14 @@ public partial interface IBillingClient global::System.Threading.Tasks.Task ListStoreCostInfoAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List store cost information + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListStoreCostInfoAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ICompletionsClient.CreateChatCompletion.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ICompletionsClient.CreateChatCompletion.g.cs index aad6780..3ce592c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ICompletionsClient.CreateChatCompletion.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ICompletionsClient.CreateChatCompletion.g.cs @@ -24,5 +24,25 @@ public partial interface ICompletionsClient global::System.Threading.Tasks.Task CreateChatCompletionAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a chat completion
+ /// Create a chat completion using the provided parameters.
+ /// Generates a completion response based on the chat messages and model parameters provided.
+ /// The response can be either a full completion or streamed chunks depending on the request parameters.
+ /// Args:
+ /// params: Parameters for creating the chat completion including messages, model selection,
+ /// and generation settings
+ /// user: The authenticated user making the request
+ /// Returns:
+ /// Either a ChatCompletion containing the full response, or ChatCompletionChunk for streaming
+ /// Raises:
+ /// HTTPException: If there is an error creating the completion (500) + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateChatCompletionAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.AuthorizeDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.AuthorizeDataSource.g.cs index 34658ca..23a96ac 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.AuthorizeDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.AuthorizeDataSource.g.cs @@ -28,5 +28,29 @@ public partial interface IDataSourcesClient global::System.Guid dataSourceId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Authorize a data source
+ /// Start OAuth2 authorization flow for a data source.
+ /// Initiates the OAuth2 authorization process by redirecting the user
+ /// to the external service's authorization page. After authorization,
+ /// the user will be redirected back to the oauth2_callback endpoint.
+ /// Args:
+ /// data_source_id: The ID of the data source to authorize
+ /// Returns:
+ /// Redirect to the OAuth2 provider's authorization page
+ /// Raises:
+ /// DataSourceNotFoundError: When data source doesn't exist
+ /// DataSourceAuthTypeNotSupportedError: When OAuth2 is not supported for this data source type + ///
+ /// + /// The ID of the data source to authorize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AuthorizeDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateConnector.g.cs index 6169ac4..c3fd0e2 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateConnector.g.cs @@ -38,6 +38,28 @@ public partial interface IDataSourcesClient /// /// The ID of the data source to create a connector for /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateConnectorAsResponseAsync( + global::System.Guid dataSourceId, + + global::Mixedbread.DataSourceConnectorCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a new connector
+ /// Create a new connector.
+ /// Args:
+ /// data_source_id: The ID of the data source to create a connector for.
+ /// params: The connector to create.
+ /// Returns:
+ /// The created connector. + ///
+ /// + /// The ID of the data source to create a connector for + /// /// /// The ID of the store /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateDataSource.g.cs index 529a559..32362f5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.CreateDataSource.g.cs @@ -29,6 +29,23 @@ public partial interface IDataSourcesClient /// Returns:
/// The created data source. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDataSourceAsResponseAsync( + + global::Mixedbread.AnyOf request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a new data source
+ /// Create a new data source.
+ /// Args:
+ /// params: The data source to create.
+ /// Returns:
+ /// The created data source. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteConnector.g.cs index 72332a7..681e62a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteConnector.g.cs @@ -27,5 +27,28 @@ public partial interface IDataSourcesClient global::System.Guid connectorId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a connector
+ /// Delete a connector.
+ /// Args:
+ /// data_source_id: The ID of the data source to delete a connector for.
+ /// connector_id: The ID of the connector to delete.
+ /// Returns:
+ /// The deleted connector. + ///
+ /// + /// The ID of the data source to delete a connector for + /// + /// + /// The ID of the connector to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteConnectorAsResponseAsync( + global::System.Guid dataSourceId, + global::System.Guid connectorId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteDataSource.g.cs index 487ef48..a95081c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.DeleteDataSource.g.cs @@ -20,5 +20,21 @@ public partial interface IDataSourcesClient global::System.Guid dataSourceId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a data source
+ /// Delete a data source.
+ /// Args:
+ /// data_source_id: The ID of the data source to delete. + ///
+ /// + /// The ID of the data source to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetConnector.g.cs index 2008dfc..a6ba368 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetConnector.g.cs @@ -27,5 +27,28 @@ public partial interface IDataSourcesClient global::System.Guid connectorId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a connector by ID
+ /// Get a connector by ID.
+ /// Args:
+ /// data_source_id: The ID of the data source to get a connector for.
+ /// connector_id: The ID of the connector to get.
+ /// Returns:
+ /// The connector. + ///
+ /// + /// The ID of the data source to get a connector for + /// + /// + /// The ID of the connector to get + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetConnectorAsResponseAsync( + global::System.Guid dataSourceId, + global::System.Guid connectorId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetDataSource.g.cs index 1848464..b046eea 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.GetDataSource.g.cs @@ -22,5 +22,23 @@ public partial interface IDataSourcesClient global::System.Guid dataSourceId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a data source by ID
+ /// Get a data source by ID.
+ /// Args:
+ /// data_source_id: The ID of the data source to fetch.
+ /// Returns:
+ /// The data source. + ///
+ /// + /// The ID of the data source to fetch + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListConnectors.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListConnectors.g.cs index 69798ac..1882ba9 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListConnectors.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListConnectors.g.cs @@ -41,5 +41,42 @@ public partial interface IDataSourcesClient bool? includeTotal = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get all connectors for a data source
+ /// Get all connectors for a data source.
+ /// Args:
+ /// data_source_id: The ID of the data source to get connectors for.
+ /// pagination: The pagination options.
+ /// Returns:
+ /// The list of connectors. + ///
+ /// + /// The ID of the data source to get connectors for + /// + /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListConnectorsAsResponseAsync( + global::System.Guid dataSourceId, + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListDataSources.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListDataSources.g.cs index 049484a..ca95489 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListDataSources.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.ListDataSources.g.cs @@ -34,5 +34,35 @@ public partial interface IDataSourcesClient bool? includeTotal = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get all data sources
+ /// Get all data sources.
+ /// Returns:
+ /// The list of data sources. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListDataSourcesAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.Oauth2Callback.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.Oauth2Callback.g.cs index 5be500e..355bd1b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.Oauth2Callback.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.Oauth2Callback.g.cs @@ -43,5 +43,44 @@ public partial interface IDataSourcesClient string? errorDescription = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// OAuth2 callback for data source authorization
+ /// OAuth2 callback endpoint for completing data source authorization.
+ /// This endpoint is called by OAuth2 providers after user authorization.
+ /// It exchanges the authorization code for access tokens and stores them
+ /// securely for the data source.
+ /// Args:
+ /// state: OAuth2 state parameter used for CSRF protection
+ /// code: Authorization code from the OAuth2 provider
+ /// error: OAuth2 error code if authorization was denied or failed
+ /// error_description: Human-readable description of the error
+ /// Returns:
+ /// Redirect to the data source details page on success
+ /// Raises:
+ /// OAuth2TokenExchangeError: When OAuth2 provider returns an error
+ /// InvalidStateError: When state parameter is invalid or expired + ///
+ /// + /// OAuth2 state parameter for CSRF protection + /// + /// + /// Authorization code from OAuth2 provider + /// + /// + /// OAuth2 error code if authorization failed + /// + /// + /// Human-readable error description + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task Oauth2CallbackAsResponseAsync( + string state, + string code, + string? error = default, + string? errorDescription = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateConnector.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateConnector.g.cs index ad2291c..51dc118 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateConnector.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateConnector.g.cs @@ -47,6 +47,33 @@ public partial interface IDataSourcesClient /// /// The ID of the connector to update /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateConnectorAsResponseAsync( + global::System.Guid dataSourceId, + global::System.Guid connectorId, + + global::Mixedbread.DataSourceConnectorUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a connector
+ /// Update a connector.
+ /// Args:
+ /// data_source_id: The ID of the data source to update a connector for.
+ /// connector_id: The ID of the connector to update.
+ /// params: The connector to update.
+ /// Returns:
+ /// The updated connector. + ///
+ /// + /// The ID of the data source to update a connector for + /// + /// + /// The ID of the connector to update + /// /// /// The name of the connector /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateDataSource.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateDataSource.g.cs index 52104e7..c1d7b34 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateDataSource.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IDataSourcesClient.UpdateDataSource.g.cs @@ -38,6 +38,28 @@ public partial interface IDataSourcesClient /// /// The ID of the data source to update /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateDataSourceAsResponseAsync( + global::System.Guid dataSourceId, + + global::Mixedbread.AnyOf request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a data source
+ /// Update a data source.
+ /// Args:
+ /// data_source_id: The ID of the data source to update.
+ /// params: The data source to update.
+ /// Returns:
+ /// The updated data source. + ///
+ /// + /// The ID of the data source to update + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateExtractionJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateExtractionJob.g.cs index e883c28..cdf854a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateExtractionJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateExtractionJob.g.cs @@ -29,6 +29,23 @@ public partial interface IExtractionsClient /// Returns:
/// The created extraction job. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateExtractionJobAsResponseAsync( + + global::Mixedbread.ExtractJobCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Start an extraction job
+ /// Start an extraction job for the provided file and schema.
+ /// Args:
+ /// params: The parameters for creating an extraction job.
+ /// Returns:
+ /// The created extraction job. + ///
/// /// The ID of the file to extract from /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateSchema.g.cs index f89ebdc..d7aaa42 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.CreateSchema.g.cs @@ -29,6 +29,23 @@ public partial interface IExtractionsClient /// Returns:
/// The created schema. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateSchemaAsResponseAsync( + + global::Mixedbread.JsonSchemaCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a schema
+ /// Create a schema with the provided parameters.
+ /// Args:
+ /// params: The parameters for creating a schema.
+ /// Returns:
+ /// The created schema. + ///
/// /// Description of the data to extract /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.EnhanceSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.EnhanceSchema.g.cs index 605d72a..c6b429c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.EnhanceSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.EnhanceSchema.g.cs @@ -29,6 +29,23 @@ public partial interface IExtractionsClient /// Returns:
/// The enhanced schema. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EnhanceSchemaAsResponseAsync( + + global::Mixedbread.JsonSchemaEnhanceParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enhance a schema
+ /// Enhance a schema by enriching the descriptions to aid extraction.
+ /// Args:
+ /// params: The parameters for enhancing a schema.
+ /// Returns:
+ /// The enhanced schema. + ///
/// /// The JSON schema to enhance /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ExtractContent.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ExtractContent.g.cs index faeca08..bcc3375 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ExtractContent.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ExtractContent.g.cs @@ -29,6 +29,23 @@ public partial interface IExtractionsClient /// Returns:
/// The extracted content. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ExtractContentAsResponseAsync( + + global::Mixedbread.ExtractContentCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Extract content from a string
+ /// Extract content from a string using the provided schema.
+ /// Args:
+ /// params: The parameters for extracting content from a string.
+ /// Returns:
+ /// The extracted content. + ///
/// /// The content to extract from /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.RetrieveExtractionJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.RetrieveExtractionJob.g.cs index 4fb2581..8b4068d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.RetrieveExtractionJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.RetrieveExtractionJob.g.cs @@ -22,5 +22,23 @@ public partial interface IExtractionsClient string jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get extraction job result
+ /// Get detailed information about a specific extraction job.
+ /// Args:
+ /// job_id: The ID of the extraction job.
+ /// Returns:
+ /// Detailed information about the extraction job. + ///
+ /// + /// The ID of the extraction job to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveExtractionJobAsResponseAsync( + string jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ValidateSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ValidateSchema.g.cs index 2fbd5bb..69997cd 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ValidateSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IExtractionsClient.ValidateSchema.g.cs @@ -29,6 +29,23 @@ public partial interface IExtractionsClient /// Returns:
/// The validation result. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ValidateSchemaAsResponseAsync( + + global::Mixedbread.JsonSchemaValidateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Validate a schema
+ /// Validate a schema.
+ /// Args:
+ /// params: The parameters for validating a schema.
+ /// Returns:
+ /// The validation result. + ///
/// /// The JSON schema to validate /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.AbortMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.AbortMultipartUpload.g.cs index 8e82828..65c97ae 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.AbortMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.AbortMultipartUpload.g.cs @@ -18,5 +18,19 @@ public partial interface IFilesClient global::System.Guid uploadId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Abort multipart upload
+ /// Abort a multipart upload and clean up any uploaded parts. + ///
+ /// + /// The ID of the multipart upload to abort + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AbortMultipartUploadAsResponseAsync( + global::System.Guid uploadId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CompleteMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CompleteMultipartUpload.g.cs index eebe4d2..a36628d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CompleteMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CompleteMultipartUpload.g.cs @@ -30,6 +30,24 @@ public partial interface IFilesClient /// /// The ID of the multipart upload /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CompleteMultipartUploadAsResponseAsync( + global::System.Guid uploadId, + + global::Mixedbread.CompleteMultipartUploadRequest request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Complete multipart upload
+ /// Complete a multipart upload after all parts have been uploaded.
+ /// Creates the file object and returns it. + ///
+ /// + /// The ID of the multipart upload + /// /// /// List of completed parts with their ETags /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateFile.g.cs index de67243..445eeb8 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateFile.g.cs @@ -29,6 +29,23 @@ public partial interface IFilesClient /// Returns:
/// FileResponse: The response containing the details of the uploaded file. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateFileAsResponseAsync( + + global::Mixedbread.BodyCreateFile request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload file
+ /// Upload a new file.
+ /// Args:
+ /// file: The file to upload.
+ /// Returns:
+ /// FileResponse: The response containing the details of the uploaded file. + ///
/// /// The file to upload /// @@ -43,5 +60,50 @@ public partial interface IFilesClient string filename, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload file
+ /// Upload a new file.
+ /// Args:
+ /// file: The file to upload.
+ /// Returns:
+ /// FileResponse: The response containing the details of the uploaded file. + ///
+ /// + /// The file to upload + /// + /// + /// The file to upload + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateFileAsync( + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload file
+ /// Upload a new file.
+ /// Args:
+ /// file: The file to upload.
+ /// Returns:
+ /// FileResponse: The response containing the details of the uploaded file. + ///
+ /// + /// The file to upload + /// + /// + /// The file to upload + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateFileAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateMultipartUpload.g.cs index c9865fa..e1dac94 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.CreateMultipartUpload.g.cs @@ -21,6 +21,19 @@ public partial interface IFilesClient /// Create multipart upload
/// Initiate a multipart upload and receive presigned URLs for uploading parts directly to storage. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateMultipartUploadAsResponseAsync( + + global::Mixedbread.CreateMultipartUploadRequest request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create multipart upload
+ /// Initiate a multipart upload and receive presigned URLs for uploading parts directly to storage. + ///
/// /// Name of the file including extension /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DeleteFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DeleteFile.g.cs index aa765e6..2c31b48 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DeleteFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DeleteFile.g.cs @@ -22,5 +22,23 @@ public partial interface IFilesClient global::System.Guid fileId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete file
+ /// Delete a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to delete.
+ /// Returns:
+ /// FileDeleted: The response containing the details of the deleted file. + ///
+ /// + /// The ID of the file to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteFileAsResponseAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DownloadFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DownloadFile.g.cs index b2e16d5..ad3781c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DownloadFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.DownloadFile.g.cs @@ -22,5 +22,41 @@ public partial interface IFilesClient global::System.Guid fileId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download file
+ /// Download a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to download.
+ /// Returns:
+ /// FileStreamResponse: The response containing the file to be downloaded. + ///
+ /// + /// The ID of the file to download + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DownloadFileAsStreamAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download file
+ /// Download a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to download.
+ /// Returns:
+ /// FileStreamResponse: The response containing the file to be downloaded. + ///
+ /// + /// The ID of the file to download + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DownloadFileAsResponseAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.GetMultipartUpload.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.GetMultipartUpload.g.cs index b05afb9..eb2ebb0 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.GetMultipartUpload.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.GetMultipartUpload.g.cs @@ -18,5 +18,19 @@ public partial interface IFilesClient global::System.Guid uploadId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get multipart upload details
+ /// Get a multipart upload's details with fresh presigned URLs for any parts not yet uploaded. + ///
+ /// + /// The ID of the multipart upload + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetMultipartUploadAsResponseAsync( + global::System.Guid uploadId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListFiles.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListFiles.g.cs index 96d950f..56011e5 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListFiles.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListFiles.g.cs @@ -40,5 +40,41 @@ public partial interface IFilesClient string? q = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List files
+ /// List all files for the authenticated user.
+ /// Args:
+ /// pagination: The pagination options
+ /// Returns:
+ /// A list of files belonging to the user. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Search query for fuzzy matching over name and description fields + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListFilesAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + string? q = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListMultipartUploads.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListMultipartUploads.g.cs index c070788..5c86858 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListMultipartUploads.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.ListMultipartUploads.g.cs @@ -14,5 +14,15 @@ public partial interface IFilesClient global::System.Threading.Tasks.Task ListMultipartUploadsAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List in-progress multipart uploads
+ /// List all in-progress multipart uploads for the authenticated organization. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListMultipartUploadsAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.RetrieveFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.RetrieveFile.g.cs index cef7227..fdcbba3 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.RetrieveFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.RetrieveFile.g.cs @@ -22,5 +22,23 @@ public partial interface IFilesClient global::System.Guid fileId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get file details
+ /// Retrieve details of a specific file by its ID.
+ /// Args:
+ /// file_id: The ID of the file to retrieve.
+ /// Returns:
+ /// FileResponse: The response containing the file details. + ///
+ /// + /// The ID of the file to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveFileAsResponseAsync( + global::System.Guid fileId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.UpdateFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.UpdateFile.g.cs index 5c70a7e..64c954e 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.UpdateFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IFilesClient.UpdateFile.g.cs @@ -38,6 +38,28 @@ public partial interface IFilesClient /// /// The ID of the file to update /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateFileAsResponseAsync( + global::System.Guid fileId, + + global::Mixedbread.BodyUpdateFile request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update file
+ /// Update the details of a specific file.
+ /// Args:
+ /// file_id: The ID of the file to update.
+ /// file: The new details for the file.
+ /// Returns:
+ /// FileObject: The updated file details. + ///
+ /// + /// The ID of the file to update + /// /// /// The file to update /// @@ -53,5 +75,60 @@ public partial interface IFilesClient string filename, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update file
+ /// Update the details of a specific file.
+ /// Args:
+ /// file_id: The ID of the file to update.
+ /// file: The new details for the file.
+ /// Returns:
+ /// FileObject: The updated file details. + ///
+ /// + /// The ID of the file to update + /// + /// + /// The file to update + /// + /// + /// The file to update + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateFileAsync( + global::System.Guid fileId, + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update file
+ /// Update the details of a specific file.
+ /// Args:
+ /// file_id: The ID of the file to update.
+ /// file: The new details for the file.
+ /// Returns:
+ /// FileObject: The updated file details. + ///
+ /// + /// The ID of the file to update + /// + /// + /// The file to update + /// + /// + /// The file to update + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateFileAsResponseAsync( + global::System.Guid fileId, + global::System.IO.Stream file, + string filename, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.CreateEmbeddings.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.CreateEmbeddings.g.cs index 67d0de2..132caa7 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.CreateEmbeddings.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.CreateEmbeddings.g.cs @@ -29,6 +29,23 @@ public partial interface IMixedbreadClient /// Returns:
/// EmbeddingCreateResponse: The response containing the embeddings. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateEmbeddingsAsResponseAsync( + + global::Mixedbread.EmbeddingCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create embeddings for text and images
+ /// Create embeddings for text or images using the specified model, encoding format, and normalization.
+ /// Args:
+ /// params: The parameters for creating embeddings.
+ /// Returns:
+ /// EmbeddingCreateResponse: The response containing the embeddings. + ///
/// /// The model to use for creating embeddings. /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Info.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Info.g.cs index 5c81300..2f3a989 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Info.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Info.g.cs @@ -16,5 +16,17 @@ public partial interface IMixedbreadClient global::System.Threading.Tasks.Task InfoAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Info
+ /// Returns service information, including name and version.
+ /// Returns:
+ /// InfoResponse: A response containing the service name and version. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> InfoAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Rerank.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Rerank.g.cs index 2d213d9..841ed4c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Rerank.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IMixedbreadClient.Rerank.g.cs @@ -29,6 +29,23 @@ public partial interface IMixedbreadClient /// Returns:
/// RerankResponse: The reranked documents for the input query. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RerankAsResponseAsync( + + global::Mixedbread.RerankParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Rerank different kind of documents for a given query
+ /// Rerank different kind of documents for a given query.
+ /// Args:
+ /// params: RerankParams: The parameters for reranking.
+ /// Returns:
+ /// RerankResponse: The reranked documents for the input query. + ///
/// /// The model to use for reranking documents.
/// Default Value: mixedbread-ai/mxbai-rerank-large-v2 diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CancelParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CancelParsingJob.g.cs index e85a3b2..460e6eb 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CancelParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CancelParsingJob.g.cs @@ -22,5 +22,23 @@ public partial interface IParsingClient global::System.Guid jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel a parsing job
+ /// Cancel a specific parse job.
+ /// Args:
+ /// job_id: The ID of the parse job to cancel.
+ /// Returns:
+ /// The cancelled parsing job. + ///
+ /// + /// The ID of the parse job to cancel + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CancelParsingJobAsResponseAsync( + global::System.Guid jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CreateParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CreateParsingJob.g.cs index 2edbf59..194a1af 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CreateParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.CreateParsingJob.g.cs @@ -29,6 +29,23 @@ public partial interface IParsingClient /// Returns:
/// The created parsing job. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateParsingJobAsResponseAsync( + + global::Mixedbread.ParsingJobCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Start a parse job
+ /// Start a parse job for the provided file.
+ /// Args:
+ /// params: The parameters for creating a parse job.
+ /// Returns:
+ /// The created parsing job. + ///
/// /// The ID of the file to parse /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.DeleteParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.DeleteParsingJob.g.cs index 60ad068..a53a817 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.DeleteParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.DeleteParsingJob.g.cs @@ -22,5 +22,23 @@ public partial interface IParsingClient global::System.Guid jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a parsing job
+ /// Delete a specific parse job.
+ /// Args:
+ /// job_id: The ID of the parse job to delete.
+ /// Returns:
+ /// The deleted parsing job. + ///
+ /// + /// The ID of the parse job to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteParsingJobAsResponseAsync( + global::System.Guid jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.ListParsingJobs.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.ListParsingJobs.g.cs index 1c623b1..45ec21f 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.ListParsingJobs.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.ListParsingJobs.g.cs @@ -45,5 +45,46 @@ public partial interface IParsingClient string? q = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List parsing jobs
+ /// List parsing jobs with pagination.
+ /// Args:
+ /// limit: The number of items to return.
+ /// offset: The number of items to skip.
+ /// Returns:
+ /// List of parsing jobs with pagination. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Status to filter by + /// + /// + /// Search query to filter by + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListParsingJobsAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::System.Collections.Generic.IList? statuses = default, + string? q = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.RetrieveParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.RetrieveParsingJob.g.cs index 7b4e223..0a3390c 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.RetrieveParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IParsingClient.RetrieveParsingJob.g.cs @@ -22,5 +22,23 @@ public partial interface IParsingClient global::System.Guid jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get parsing job result
+ /// Get detailed information about a specific parse job.
+ /// Args:
+ /// job_id: The ID of the parse job.
+ /// Returns:
+ /// Detailed information about the parse job. + ///
+ /// + /// The ID of the parse job to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveParsingJobAsResponseAsync( + global::System.Guid jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ISchemasClient.GetMxbaiJsonSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ISchemasClient.GetMxbaiJsonSchema.g.cs index 168ddfb..45510db 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ISchemasClient.GetMxbaiJsonSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ISchemasClient.GetMxbaiJsonSchema.g.cs @@ -16,5 +16,17 @@ public partial interface ISchemasClient global::System.Threading.Tasks.Task GetMxbaiJsonSchemaAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get mxbai json schema
+ /// Get the mxbai json schema.
+ /// Returns:
+ /// The mxbai json schema. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetMxbaiJsonSchemaAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateQuestionAnswering.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateQuestionAnswering.g.cs index c0a107c..df1e41b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateQuestionAnswering.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateQuestionAnswering.g.cs @@ -19,6 +19,18 @@ public partial interface IStoresClient /// /// Question answering /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateQuestionAnsweringAsResponseAsync( + + global::Mixedbread.StoreQAParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Question answering + /// /// /// Question to answer. If not provided, the question will be extracted from the passed messages. /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateSearchRule.g.cs index e60784c..f05f1f7 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateSearchRule.g.cs @@ -38,6 +38,28 @@ public partial interface IStoresClient /// /// The ID or name of the store /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create search rule
+ /// Create a new search rule for a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_create: Search rule creation parameters
+ /// Returns:
+ /// SearchRuleResponse: The created search rule details + ///
+ /// + /// The ID or name of the store + /// /// /// The query pattern to match /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStore.g.cs index 3dd73e4..688d1d9 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStore.g.cs @@ -29,6 +29,23 @@ public partial interface IStoresClient /// Returns:
/// VectorStore: The response containing the created vector store details. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateStoreAsResponseAsync( + + global::Mixedbread.StoreCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a store
+ /// Create a new vector store.
+ /// Args:
+ /// vector_store_create: VectorStoreCreate object containing the name, description, and metadata.
+ /// Returns:
+ /// VectorStore: The response containing the created vector store details. + ///
/// /// Name for the new store. Can only contain lowercase letters, numbers, periods (.), and hyphens (-). /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStoreFile.g.cs index 682c53d..e28f85a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.CreateStoreFile.g.cs @@ -40,6 +40,28 @@ public partial interface IStoresClient /// /// The ID or name of the store /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + + global::Mixedbread.DeprecatedStoreFileUpsertParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload file to store
+ /// Upload a file to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_add_params: The file to add to the store.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// /// /// Optional metadata for the file /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSearchRule.g.cs index 73c5d36..8de7cdd 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSearchRule.g.cs @@ -27,5 +27,28 @@ public partial interface IStoresClient global::System.Guid ruleId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a search rule
+ /// Delete a search rule by ID.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule to delete
+ /// Returns:
+ /// SearchRuleDeleted: The deleted search rule details + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSpecificSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSpecificSearchRule.g.cs index 58f540b..247d516 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSpecificSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteSpecificSearchRule.g.cs @@ -47,6 +47,33 @@ public partial interface IStoresClient /// /// The ID of the search rule /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteSpecificSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleSpecificDeleteParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a specific rule from rules array
+ /// Delete a specific rule from within a search rule's rules array.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule containing the rule to delete
+ /// rule_delete: The specific rule to delete from the rules array
+ /// Returns:
+ /// SearchRuleSpecificDeleted: Details about the deletion operation + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule + /// /// /// The specific rule to delete from the rules array /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStore.g.cs index 9c8f5ab..0822208 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStore.g.cs @@ -22,5 +22,23 @@ public partial interface IStoresClient global::Mixedbread.AnyOf storeIdentifier, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a store
+ /// Delete a store by ID or name.
+ /// Args:
+ /// store_identifier: The ID or name of the store to delete.
+ /// Returns:
+ /// Store: The response containing the deleted store details. + ///
+ /// + /// The ID or name of the store to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteStoreAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStoreFile.g.cs index 3c39f28..07287fb 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.DeleteStoreFile.g.cs @@ -27,5 +27,28 @@ public partial interface IStoresClient global::Mixedbread.AnyOf fileIdentifier, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete store file
+ /// Delete a file from a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_id: The ID or name of the file to delete.
+ /// Returns:
+ /// VectorStoreFileDeleted: The deleted file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID or name of the file to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AnyOf fileIdentifier, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetMetadataFacets.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetMetadataFacets.g.cs index 4ee6260..f63cfef 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetMetadataFacets.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetMetadataFacets.g.cs @@ -19,6 +19,18 @@ public partial interface IStoresClient /// /// Get metadata facets /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetMetadataFacetsAsResponseAsync( + + global::Mixedbread.MetadataFacetsParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get metadata facets + /// /// /// Search query text /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetStoreEventHistogram.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetStoreEventHistogram.g.cs index 6983bcc..feda309 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetStoreEventHistogram.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.GetStoreEventHistogram.g.cs @@ -38,6 +38,28 @@ public partial interface IStoresClient /// /// The ID or name of the store /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetStoreEventHistogramAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + + global::Mixedbread.StoreEventHistogramParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get store event histogram
+ /// Get histogram of store events over time.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// histogram_params: Parameters for histogram generation.
+ /// Returns:
+ /// StoreEventHistogramResponse: The event histogram. + ///
+ /// + /// The ID or name of the store + /// /// /// Start time of the histogram /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreEvents.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreEvents.g.cs index a2c4cac..885f9b9 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreEvents.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreEvents.g.cs @@ -53,5 +53,54 @@ public partial interface IStoresClient global::System.DateTime? filterAfter = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List events for a store
+ /// List events for a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// options: The pagination options.
+ /// Returns:
+ /// StoreEventListResponse: The list of events for the store. + ///
+ /// + /// The ID or name of the store + /// + /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Time to filter events before + /// + /// + /// Time to filter events after + /// + /// + /// The type of event to list + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListStoreEventsAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.ListStoreEventsEventType eventType, + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::System.DateTime? filterBefore = default, + global::System.DateTime? filterAfter = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreFilesWithMetadataFilter.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreFilesWithMetadataFilter.g.cs index 00e863f..bee5770 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreFilesWithMetadataFilter.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStoreFilesWithMetadataFilter.g.cs @@ -38,6 +38,28 @@ public partial interface IStoresClient /// /// The ID or name of the store /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListStoreFilesWithMetadataFilterAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + + global::Mixedbread.SearchCursorPagination request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List store files with metadata filter
+ /// List files indexed in a vector store with pagination and metadata filter.
+ /// Args:
+ /// vector_store_identifier: The ID or name of the vector store
+ /// pagination: Pagination parameters and metadata filter
+ /// Returns:
+ /// VectorStoreFileListResponse: Paginated list of vector store files + ///
+ /// + /// The ID or name of the store + /// /// /// Maximum number of items to return per page (1-100)
/// Default Value: 20 diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStores.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStores.g.cs index fd81356..ec40e64 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStores.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.ListStores.g.cs @@ -41,5 +41,42 @@ public partial interface IStoresClient string? q = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List stores
+ /// List all stores with optional search.
+ /// Args:
+ /// pagination: The pagination options.
+ /// q: Optional search query to filter vector stores.
+ /// Returns:
+ /// StoreListResponse: The list of stores. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Search query for fuzzy matching over name and description fields + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListStoresAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + string? q = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveSearchRule.g.cs index 3c5225a..3eec031 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveSearchRule.g.cs @@ -27,5 +27,28 @@ public partial interface IStoresClient global::System.Guid ruleId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a search rule
+ /// Get a search rule by ID.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule to retrieve
+ /// Returns:
+ /// SearchRuleResponse: The search rule details + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStore.g.cs index 9664486..f7f276a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStore.g.cs @@ -22,5 +22,23 @@ public partial interface IStoresClient global::Mixedbread.AnyOf storeIdentifier, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a store
+ /// Get a store by ID or name.
+ /// Args:
+ /// store_identifier: The ID or name of the store to retrieve.
+ /// Returns:
+ /// Store: The response containing the store details. + ///
+ /// + /// The ID or name of the store + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveStoreAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStoreFile.g.cs index ac22486..2d01ee8 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.RetrieveStoreFile.g.cs @@ -33,5 +33,34 @@ public partial interface IStoresClient global::Mixedbread.AnyOf>? returnChunks = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get store file
+ /// Get a file from a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_id: The ID or name of the file.
+ /// options: Get file options.
+ /// Returns:
+ /// VectorStoreFile: The file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID or name of the file + /// + /// + /// Whether to return the chunks for the file. If a list of integers is provided, only the chunks at the specified indices will be returned.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AnyOf fileIdentifier, + global::Mixedbread.AnyOf>? returnChunks = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.SearchStoreChunks.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.SearchStoreChunks.g.cs index a746474..05ad91d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.SearchStoreChunks.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.SearchStoreChunks.g.cs @@ -65,6 +65,41 @@ public partial interface IStoresClient /// HTTPException (400): If search parameters are invalid
/// HTTPException (404): If no vector stores are found to search /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SearchStoreChunksAsResponseAsync( + + global::Mixedbread.StoreChunkSearchParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Perform semantic search across store chunks
+ /// Perform semantic search across store chunks.
+ /// This endpoint searches through store chunks using semantic similarity matching.
+ /// It supports complex search queries with filters and returns relevance-scored results.
+ /// For the special 'mixedbread/web' store, this endpoint performs web search using
+ /// a mixture of different providers instead of semantic search. Web search results are always
+ /// reranked for consistent scoring.
+ /// Args:
+ /// search_params: Search configuration including:
+ /// - query text or embeddings
+ /// - store_identifiers: List of store identifiers to search
+ /// - file_ids: Optional list of file IDs to filter chunks by (or tuple of list and condition operator)
+ /// - metadata filters
+ /// - pagination parameters
+ /// - sorting preferences
+ /// _state: API state dependency
+ /// _ctx: Service context dependency
+ /// Returns:
+ /// StoreSearchResponse containing:
+ /// - List of matched chunks with relevance scores
+ /// - Pagination details including total result count
+ /// Raises:
+ /// HTTPException (400): If search parameters are invalid
+ /// HTTPException (404): If no vector stores are found to search + ///
/// /// Search query text /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateSearchRule.g.cs index 8b6e1ce..0a39825 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateSearchRule.g.cs @@ -47,6 +47,33 @@ public partial interface IStoresClient /// /// The ID of the search rule to update /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a search rule
+ /// Update a search rule by ID.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule to update
+ /// rule_update: SearchRuleUpdateParams object containing the fields to update
+ /// Returns:
+ /// SearchRuleResponse: The updated search rule details + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule to update + /// /// /// The query pattern to match /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStore.g.cs index d0fa93b..f6f6afd 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStore.g.cs @@ -38,6 +38,28 @@ public partial interface IStoresClient /// /// The ID or name of the store /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateStoreAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + + global::Mixedbread.StoreUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a store
+ /// Update a store by ID or name.
+ /// Args:
+ /// store_identifier: The ID or name of the store to update.
+ /// store_update: StoreCreate object containing the name, description, and metadata.
+ /// Returns:
+ /// Store: The response containing the updated store details. + ///
+ /// + /// The ID or name of the store + /// /// /// New name for the store. Can only contain lowercase letters, numbers, periods (.), and hyphens (-). /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStoreFile.g.cs index ef6f218..28d6ab8 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UpdateStoreFile.g.cs @@ -47,6 +47,33 @@ public partial interface IStoresClient /// /// The ID or name of the file to update /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AnyOf fileIdentifier, + + global::Mixedbread.StoreFileMetadataUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update store file metadata
+ /// Update metadata on a file within a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_identifier: The ID or name of the file to update.
+ /// update_params: Metadata update payload.
+ /// Returns:
+ /// StoreFile: The updated file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID or name of the file to update + /// /// /// Updated metadata for the file /// diff --git a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UploadStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UploadStoreFile.g.cs index 4577913..905c664 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UploadStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.IStoresClient.UploadStoreFile.g.cs @@ -42,6 +42,30 @@ public partial interface IStoresClient /// /// The ID or name of the store /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + + global::Mixedbread.BodyUploadStoreFile request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload file via form to store
+ /// Upload a file via form to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// config: The config for the file.
+ /// metadata: The metadata for the file.
+ /// file: The file to upload.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// /// /// The file to upload and index /// @@ -59,5 +83,68 @@ public partial interface IStoresClient string? @params = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload file via form to store
+ /// Upload a file via form to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// config: The config for the file.
+ /// metadata: The metadata for the file.
+ /// file: The file to upload.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The file to upload and index + /// + /// + /// The file to upload and index + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UploadStoreFileAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.IO.Stream file, + string filename, + string? @params = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload file via form to store
+ /// Upload a file via form to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// config: The config for the file.
+ /// metadata: The metadata for the file.
+ /// file: The file to upload.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The file to upload and index + /// + /// + /// The file to upload and index + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.IO.Stream file, + string filename, + string? @params = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.CreateEmbeddings.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.CreateEmbeddings.g.cs index 97f2a6b..d91ae2a 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.CreateEmbeddings.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.CreateEmbeddings.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateEmbeddingsResponseContent( /// public async global::System.Threading.Tasks.Task CreateEmbeddingsAsync( + global::Mixedbread.EmbeddingCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateEmbeddingsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create embeddings for text and images
+ /// Create embeddings for text or images using the specified model, encoding format, and normalization.
+ /// Args:
+ /// params: The parameters for creating embeddings.
+ /// Returns:
+ /// EmbeddingCreateResponse: The response containing the embeddings. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateEmbeddingsAsResponseAsync( + global::Mixedbread.EmbeddingCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessCreateEmbeddingsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/embeddings", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessCreateEmbeddingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessCreateEmbeddingsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessCreateEmbeddingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessCreateEmbeddingsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessCreateEmbeddingsResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessCreateEmbeddingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessCreateEmbeddingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessCreateEmbeddingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessCreateEmbeddingsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.EmbeddingCreateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.EmbeddingCreateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessCreateEmbeddingsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.EmbeddingCreateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.EmbeddingCreateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Info.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Info.g.cs index 256bc16..3f604c9 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Info.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Info.g.cs @@ -74,6 +74,26 @@ partial void ProcessInfoResponseContent( public async global::System.Threading.Tasks.Task InfoAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InfoAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Info
+ /// Returns service information, including name and version.
+ /// Returns:
+ /// InfoResponse: A response containing the service name and version. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> InfoAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +122,7 @@ partial void ProcessInfoResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/", baseUri: ResolveBaseUri( @@ -176,6 +197,8 @@ partial void ProcessInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +209,11 @@ partial void ProcessInfoResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +231,8 @@ partial void ProcessInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +242,7 @@ partial void ProcessInfoResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +251,11 @@ partial void ProcessInfoResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +272,15 @@ partial void ProcessInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +320,8 @@ partial void ProcessInfoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +342,8 @@ partial void ProcessInfoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Info failed @@ -367,9 +406,13 @@ partial void ProcessInfoResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.InfoResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.InfoResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,9 +440,13 @@ partial void ProcessInfoResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.InfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.InfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Rerank.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Rerank.g.cs index 5da8101..086727b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Rerank.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.Rerank.g.cs @@ -78,6 +78,33 @@ partial void ProcessRerankResponseContent( /// public async global::System.Threading.Tasks.Task RerankAsync( + global::Mixedbread.RerankParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RerankAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Rerank different kind of documents for a given query
+ /// Rerank different kind of documents for a given query.
+ /// Args:
+ /// params: RerankParams: The parameters for reranking.
+ /// Returns:
+ /// RerankResponse: The reranked documents for the input query. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RerankAsResponseAsync( + global::Mixedbread.RerankParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessRerankResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/reranking", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessRerankResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessRerankResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessRerankResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessRerankResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessRerankResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessRerankResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessRerankResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessRerankResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessRerankResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.RerankResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.RerankResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessRerankResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.RerankResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.RerankResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.g.cs index 14a5bf1..dcbfd1d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.MixedbreadClient.g.cs @@ -45,7 +45,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public AdminClient Admin => new AdminClient(HttpClient, authorizations: Authorizations, options: Options) + public AdminClient Admin => new AdminClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -55,7 +55,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public ApiKeysClient ApiKeys => new ApiKeysClient(HttpClient, authorizations: Authorizations, options: Options) + public ApiKeysClient ApiKeys => new ApiKeysClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -65,7 +65,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public BillingClient Billing => new BillingClient(HttpClient, authorizations: Authorizations, options: Options) + public BillingClient Billing => new BillingClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -75,7 +75,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public CompletionsClient Completions => new CompletionsClient(HttpClient, authorizations: Authorizations, options: Options) + public CompletionsClient Completions => new CompletionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -85,7 +85,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public DataSourcesClient DataSources => new DataSourcesClient(HttpClient, authorizations: Authorizations, options: Options) + public DataSourcesClient DataSources => new DataSourcesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -95,7 +95,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public ExtractionsClient Extractions => new ExtractionsClient(HttpClient, authorizations: Authorizations, options: Options) + public ExtractionsClient Extractions => new ExtractionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -105,7 +105,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public FilesClient Files => new FilesClient(HttpClient, authorizations: Authorizations, options: Options) + public FilesClient Files => new FilesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -115,7 +115,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public ParsingClient Parsing => new ParsingClient(HttpClient, authorizations: Authorizations, options: Options) + public ParsingClient Parsing => new ParsingClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -125,7 +125,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public SchemasClient Schemas => new SchemasClient(HttpClient, authorizations: Authorizations, options: Options) + public SchemasClient Schemas => new SchemasClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -135,7 +135,7 @@ public sealed partial class MixedbreadClient : global::Mixedbread.IMixedbreadCli /// /// /// - public StoresClient Stores => new StoresClient(HttpClient, authorizations: Authorizations, options: Options) + public StoresClient Stores => new StoresClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -213,10 +213,10 @@ public MixedbreadClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public MixedbreadClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.OptionsSupport.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.OptionsSupport.g.cs index 11fe6cd..7918839 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.OptionsSupport.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::Mixedbread.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::Mixedbread.AutoSDKClientOptions clientOptions, global::Mixedbread.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Mixedbread.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::Mixedbread.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode( diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CancelParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CancelParsingJob.g.cs index 31bfab7..4bffd31 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CancelParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CancelParsingJob.g.cs @@ -82,6 +82,33 @@ partial void ProcessCancelParsingJobResponseContent( global::System.Guid jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelParsingJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel a parsing job
+ /// Cancel a specific parse job.
+ /// Args:
+ /// job_id: The ID of the parse job to cancel.
+ /// Returns:
+ /// The cancelled parsing job. + ///
+ /// + /// The ID of the parse job to cancel + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CancelParsingJobAsResponseAsync( + global::System.Guid jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessCancelParsingJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/parsing/jobs/{jobId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessCancelParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessCancelParsingJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessCancelParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessCancelParsingJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessCancelParsingJobResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessCancelParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessCancelParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessCancelParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessCancelParsingJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ParsingJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ParsingJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessCancelParsingJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ParsingJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ParsingJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CreateParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CreateParsingJob.g.cs index 1102059..212d562 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CreateParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.CreateParsingJob.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateParsingJobResponseContent( /// public async global::System.Threading.Tasks.Task CreateParsingJobAsync( + global::Mixedbread.ParsingJobCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateParsingJobAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Start a parse job
+ /// Start a parse job for the provided file.
+ /// Args:
+ /// params: The parameters for creating a parse job.
+ /// Returns:
+ /// The created parsing job. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateParsingJobAsResponseAsync( + global::Mixedbread.ParsingJobCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessCreateParsingJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/parsing/jobs", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessCreateParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessCreateParsingJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessCreateParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessCreateParsingJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessCreateParsingJobResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessCreateParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessCreateParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessCreateParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessCreateParsingJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ParsingJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ParsingJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessCreateParsingJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ParsingJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ParsingJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.DeleteParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.DeleteParsingJob.g.cs index 06c9c83..e09927d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.DeleteParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.DeleteParsingJob.g.cs @@ -82,6 +82,33 @@ partial void ProcessDeleteParsingJobResponseContent( global::System.Guid jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteParsingJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a parsing job
+ /// Delete a specific parse job.
+ /// Args:
+ /// job_id: The ID of the parse job to delete.
+ /// Returns:
+ /// The deleted parsing job. + ///
+ /// + /// The ID of the parse job to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteParsingJobAsResponseAsync( + global::System.Guid jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessDeleteParsingJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/parsing/jobs/{jobId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessDeleteParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessDeleteParsingJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessDeleteParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessDeleteParsingJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessDeleteParsingJobResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessDeleteParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessDeleteParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessDeleteParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessDeleteParsingJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ParsingJobDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ParsingJobDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessDeleteParsingJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ParsingJobDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ParsingJobDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.ListParsingJobs.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.ListParsingJobs.g.cs index fe77351..a0fb1ee 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.ListParsingJobs.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.ListParsingJobs.g.cs @@ -115,6 +115,61 @@ partial void ProcessListParsingJobsResponseContent( string? q = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListParsingJobsAsResponseAsync( + limit: limit, + after: after, + before: before, + includeTotal: includeTotal, + statuses: statuses, + q: q, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List parsing jobs
+ /// List parsing jobs with pagination.
+ /// Args:
+ /// limit: The number of items to return.
+ /// offset: The number of items to skip.
+ /// Returns:
+ /// List of parsing jobs with pagination. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Status to filter by + /// + /// + /// Search query to filter by + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListParsingJobsAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::System.Collections.Generic.IList? statuses = default, + string? q = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -149,18 +204,19 @@ partial void ProcessListParsingJobsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/parsing/jobs", baseUri: ResolveBaseUri( servers: s_ListParsingJobsServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) .AddOptionalParameter("before", before) .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) .AddOptionalParameter("statuses", statuses?.ToString()) - .AddOptionalParameter("q", q) + .AddOptionalParameter("q", q) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -237,6 +293,8 @@ partial void ProcessListParsingJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -247,6 +305,11 @@ partial void ProcessListParsingJobsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -264,6 +327,8 @@ partial void ProcessListParsingJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -273,8 +338,7 @@ partial void ProcessListParsingJobsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -283,6 +347,11 @@ partial void ProcessListParsingJobsResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -299,14 +368,15 @@ partial void ProcessListParsingJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -346,6 +416,8 @@ partial void ProcessListParsingJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -366,6 +438,8 @@ partial void ProcessListParsingJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -428,9 +502,13 @@ partial void ProcessListParsingJobsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ParsingJobListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ParsingJobListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -458,9 +536,13 @@ partial void ProcessListParsingJobsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ParsingJobListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ParsingJobListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.RetrieveParsingJob.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.RetrieveParsingJob.g.cs index 858ccea..4f0343d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.RetrieveParsingJob.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.RetrieveParsingJob.g.cs @@ -82,6 +82,33 @@ partial void ProcessRetrieveParsingJobResponseContent( global::System.Guid jobId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveParsingJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get parsing job result
+ /// Get detailed information about a specific parse job.
+ /// Args:
+ /// job_id: The ID of the parse job.
+ /// Returns:
+ /// Detailed information about the parse job. + ///
+ /// + /// The ID of the parse job to retrieve + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveParsingJobAsResponseAsync( + global::System.Guid jobId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessRetrieveParsingJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/parsing/jobs/{jobId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessRetrieveParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessRetrieveParsingJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessRetrieveParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessRetrieveParsingJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessRetrieveParsingJobResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessRetrieveParsingJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessRetrieveParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessRetrieveParsingJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessRetrieveParsingJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.ParsingJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.ParsingJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessRetrieveParsingJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.ParsingJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.ParsingJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs index 706e149..26418c9 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.ParsingClient.g.cs @@ -113,10 +113,10 @@ public ParsingClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ParsingClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.ResponseStream.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.ResponseStream.g.cs new file mode 100644 index 0000000..b3076af --- /dev/null +++ b/src/libs/Mixedbread/Generated/Mixedbread.ResponseStream.g.cs @@ -0,0 +1,117 @@ + +#nullable enable + +namespace Mixedbread +{ + internal sealed class ResponseStream : global::System.IO.Stream + { + private readonly global::System.Net.Http.HttpResponseMessage _response; + private readonly global::System.IO.Stream _stream; + private bool _disposed; + + public ResponseStream( + global::System.Net.Http.HttpResponseMessage response, + global::System.IO.Stream stream) + { + _response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + _stream = stream ?? throw new global::System.ArgumentNullException(nameof(stream)); + } + + public override bool CanRead => _stream.CanRead; + public override bool CanSeek => _stream.CanSeek; + public override bool CanWrite => _stream.CanWrite; + public override bool CanTimeout => _stream.CanTimeout; + public override long Length => _stream.Length; + + public override long Position + { + get => _stream.Position; + set => _stream.Position = value; + } + + public override int ReadTimeout + { + get => _stream.ReadTimeout; + set => _stream.ReadTimeout = value; + } + + public override int WriteTimeout + { + get => _stream.WriteTimeout; + set => _stream.WriteTimeout = value; + } + + public override void Flush() => _stream.Flush(); + + public override global::System.Threading.Tasks.Task FlushAsync( + global::System.Threading.CancellationToken cancellationToken) => + _stream.FlushAsync(cancellationToken); + + public override int Read(byte[] buffer, int offset, int count) => + _stream.Read(buffer, offset, count); + + public override global::System.Threading.Tasks.Task ReadAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.ReadAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask ReadAsync( + global::System.Memory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.ReadAsync(buffer, cancellationToken); +#endif + + public override long Seek(long offset, global::System.IO.SeekOrigin origin) => + _stream.Seek(offset, origin); + + public override void SetLength(long value) => + _stream.SetLength(value); + + public override void Write(byte[] buffer, int offset, int count) => + _stream.Write(buffer, offset, count); + + public override global::System.Threading.Tasks.Task WriteAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.WriteAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask WriteAsync( + global::System.ReadOnlyMemory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.WriteAsync(buffer, cancellationToken); +#endif + + protected override void Dispose(bool disposing) + { + if (!_disposed && disposing) + { + _disposed = true; + _stream.Dispose(); + _response.Dispose(); + } + + base.Dispose(disposing); + } + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override async global::System.Threading.Tasks.ValueTask DisposeAsync() + { + if (_disposed) + { + return; + } + + _disposed = true; + await _stream.DisposeAsync().ConfigureAwait(false); + _response.Dispose(); + await base.DisposeAsync().ConfigureAwait(false); + } +#endif + } +} \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.GetMxbaiJsonSchema.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.GetMxbaiJsonSchema.g.cs index fc7238a..4acb9a0 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.GetMxbaiJsonSchema.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.GetMxbaiJsonSchema.g.cs @@ -74,6 +74,26 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( public async global::System.Threading.Tasks.Task GetMxbaiJsonSchemaAsync( global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetMxbaiJsonSchemaAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get mxbai json schema
+ /// Get the mxbai json schema.
+ /// Returns:
+ /// The mxbai json schema. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetMxbaiJsonSchemaAsResponseAsync( + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +122,7 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/schemas/mxjson", baseUri: ResolveBaseUri( @@ -176,6 +197,8 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +209,11 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +231,8 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +242,7 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +251,11 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +272,15 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +320,8 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +342,8 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,7 +368,11 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -357,7 +400,11 @@ partial void ProcessGetMxbaiJsonSchemaResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs index 1eba18e..60fe2da 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.SchemasClient.g.cs @@ -113,10 +113,10 @@ public SchemasClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SchemasClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateQuestionAnswering.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateQuestionAnswering.g.cs index c22e105..0b66766 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateQuestionAnswering.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateQuestionAnswering.g.cs @@ -73,6 +73,28 @@ partial void ProcessCreateQuestionAnsweringResponseContent( /// public async global::System.Threading.Tasks.Task CreateQuestionAnsweringAsync( + global::Mixedbread.StoreQAParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateQuestionAnsweringAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Question answering + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateQuestionAnsweringAsResponseAsync( + global::Mixedbread.StoreQAParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,10 +125,11 @@ partial void ProcessCreateQuestionAnsweringResponseContent( var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/stores/question-answering", baseUri: ResolveBaseUri( @@ -188,6 +211,8 @@ partial void ProcessCreateQuestionAnsweringResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +223,11 @@ partial void ProcessCreateQuestionAnsweringResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +245,8 @@ partial void ProcessCreateQuestionAnsweringResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +256,7 @@ partial void ProcessCreateQuestionAnsweringResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +265,11 @@ partial void ProcessCreateQuestionAnsweringResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +286,15 @@ partial void ProcessCreateQuestionAnsweringResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +334,8 @@ partial void ProcessCreateQuestionAnsweringResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +356,8 @@ partial void ProcessCreateQuestionAnsweringResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -379,9 +420,13 @@ partial void ProcessCreateQuestionAnsweringResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreQAResults.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreQAResults.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -409,9 +454,13 @@ partial void ProcessCreateQuestionAnsweringResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreQAResults.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreQAResults.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateSearchRule.g.cs index 10cd126..0396393 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateSearchRule.g.cs @@ -85,6 +85,39 @@ partial void ProcessCreateSearchRuleResponseContent( public async global::System.Threading.Tasks.Task CreateSearchRuleAsync( global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateSearchRuleAsResponseAsync( + storeIdentifier: storeIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create search rule
+ /// Create a new search rule for a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_create: Search rule creation parameters
+ /// Returns:
+ /// SearchRuleResponse: The created search rule details + ///
+ /// + /// The ID or name of the store + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,6 +153,7 @@ partial void ProcessCreateSearchRuleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/rules", baseUri: ResolveBaseUri( @@ -202,6 +236,8 @@ partial void ProcessCreateSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessCreateSearchRuleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessCreateSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessCreateSearchRuleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessCreateSearchRuleResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessCreateSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessCreateSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessCreateSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -393,9 +445,13 @@ partial void ProcessCreateSearchRuleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -423,9 +479,13 @@ partial void ProcessCreateSearchRuleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStore.g.cs index f1b1884..cbcec88 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStore.g.cs @@ -78,6 +78,33 @@ partial void ProcessCreateStoreResponseContent( /// public async global::System.Threading.Tasks.Task CreateStoreAsync( + global::Mixedbread.StoreCreateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateStoreAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a store
+ /// Create a new vector store.
+ /// Args:
+ /// vector_store_create: VectorStoreCreate object containing the name, description, and metadata.
+ /// Returns:
+ /// VectorStore: The response containing the created vector store details. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateStoreAsResponseAsync( + global::Mixedbread.StoreCreateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +139,7 @@ partial void ProcessCreateStoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/stores", baseUri: ResolveBaseUri( @@ -193,6 +221,8 @@ partial void ProcessCreateStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +233,11 @@ partial void ProcessCreateStoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +255,8 @@ partial void ProcessCreateStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +266,7 @@ partial void ProcessCreateStoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +275,11 @@ partial void ProcessCreateStoreResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +296,15 @@ partial void ProcessCreateStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +344,8 @@ partial void ProcessCreateStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +366,8 @@ partial void ProcessCreateStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +430,13 @@ partial void ProcessCreateStoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.Store.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.Store.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +464,13 @@ partial void ProcessCreateStoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.Store.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.Store.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStoreFile.g.cs index 1bee3c5..3b769c4 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.CreateStoreFile.g.cs @@ -87,6 +87,39 @@ partial void ProcessCreateStoreFileResponseContent( public async global::System.Threading.Tasks.Task CreateStoreFileAsync( global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.DeprecatedStoreFileUpsertParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateStoreFileAsResponseAsync( + storeIdentifier: storeIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload file to store
+ /// Upload a file to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_add_params: The file to add to the store.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.DeprecatedStoreFileUpsertParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -122,6 +155,7 @@ partial void ProcessCreateStoreFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/files", baseUri: ResolveBaseUri( @@ -204,6 +238,8 @@ partial void ProcessCreateStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -214,6 +250,11 @@ partial void ProcessCreateStoreFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -231,6 +272,8 @@ partial void ProcessCreateStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -240,8 +283,7 @@ partial void ProcessCreateStoreFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -250,6 +292,11 @@ partial void ProcessCreateStoreFileResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -266,14 +313,15 @@ partial void ProcessCreateStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -313,6 +361,8 @@ partial void ProcessCreateStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -333,6 +383,8 @@ partial void ProcessCreateStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -395,9 +447,13 @@ partial void ProcessCreateStoreFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -425,9 +481,13 @@ partial void ProcessCreateStoreFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSearchRule.g.cs index 95b9d2d..9928f93 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSearchRule.g.cs @@ -89,6 +89,39 @@ partial void ProcessDeleteSearchRuleResponseContent( global::System.Guid ruleId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteSearchRuleAsResponseAsync( + storeIdentifier: storeIdentifier, + ruleId: ruleId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a search rule
+ /// Delete a search rule by ID.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule to delete
+ /// Returns:
+ /// SearchRuleDeleted: The deleted search rule details + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +152,7 @@ partial void ProcessDeleteSearchRuleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/rules/{ruleId}", baseUri: ResolveBaseUri( @@ -195,6 +229,8 @@ partial void ProcessDeleteSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +241,11 @@ partial void ProcessDeleteSearchRuleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +263,8 @@ partial void ProcessDeleteSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +274,7 @@ partial void ProcessDeleteSearchRuleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +283,11 @@ partial void ProcessDeleteSearchRuleResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +304,15 @@ partial void ProcessDeleteSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +352,8 @@ partial void ProcessDeleteSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +374,8 @@ partial void ProcessDeleteSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +438,13 @@ partial void ProcessDeleteSearchRuleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +472,13 @@ partial void ProcessDeleteSearchRuleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSpecificSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSpecificSearchRule.g.cs index 57364b3..1cd071d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSpecificSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteSpecificSearchRule.g.cs @@ -92,6 +92,45 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( global::Mixedbread.AnyOf storeIdentifier, global::System.Guid ruleId, + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleSpecificDeleteParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteSpecificSearchRuleAsResponseAsync( + storeIdentifier: storeIdentifier, + ruleId: ruleId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a specific rule from rules array
+ /// Delete a specific rule from within a search rule's rules array.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule containing the rule to delete
+ /// rule_delete: The specific rule to delete from the rules array
+ /// Returns:
+ /// SearchRuleSpecificDeleted: Details about the deletion operation + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteSpecificSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleSpecificDeleteParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -128,6 +167,7 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/rules/{ruleId}/specific", baseUri: ResolveBaseUri( @@ -211,6 +251,8 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +263,11 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +285,8 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +296,7 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +305,11 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +326,15 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +374,8 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +396,8 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -402,9 +460,13 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleSpecificDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleSpecificDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -432,9 +494,13 @@ partial void ProcessDeleteSpecificSearchRuleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleSpecificDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleSpecificDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStore.g.cs index 1a8cb82..169f81d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStore.g.cs @@ -82,6 +82,33 @@ partial void ProcessDeleteStoreResponseContent( global::Mixedbread.AnyOf storeIdentifier, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteStoreAsResponseAsync( + storeIdentifier: storeIdentifier, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a store
+ /// Delete a store by ID or name.
+ /// Args:
+ /// store_identifier: The ID or name of the store to delete.
+ /// Returns:
+ /// Store: The response containing the deleted store details. + ///
+ /// + /// The ID or name of the store to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteStoreAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessDeleteStoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessDeleteStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessDeleteStoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessDeleteStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessDeleteStoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessDeleteStoreResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessDeleteStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessDeleteStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessDeleteStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessDeleteStoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessDeleteStoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStoreFile.g.cs index e414178..a3c40af 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.DeleteStoreFile.g.cs @@ -89,6 +89,39 @@ partial void ProcessDeleteStoreFileResponseContent( global::Mixedbread.AnyOf fileIdentifier, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteStoreFileAsResponseAsync( + storeIdentifier: storeIdentifier, + fileIdentifier: fileIdentifier, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete store file
+ /// Delete a file from a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_id: The ID or name of the file to delete.
+ /// Returns:
+ /// VectorStoreFileDeleted: The deleted file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID or name of the file to delete + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AnyOf fileIdentifier, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +152,7 @@ partial void ProcessDeleteStoreFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/files/{fileIdentifier}", baseUri: ResolveBaseUri( @@ -195,6 +229,8 @@ partial void ProcessDeleteStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +241,11 @@ partial void ProcessDeleteStoreFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +263,8 @@ partial void ProcessDeleteStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +274,7 @@ partial void ProcessDeleteStoreFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +283,11 @@ partial void ProcessDeleteStoreFileResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +304,15 @@ partial void ProcessDeleteStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +352,8 @@ partial void ProcessDeleteStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +374,8 @@ partial void ProcessDeleteStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +438,13 @@ partial void ProcessDeleteStoreFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreFileDeleted.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreFileDeleted.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +472,13 @@ partial void ProcessDeleteStoreFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreFileDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreFileDeleted.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetMetadataFacets.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetMetadataFacets.g.cs index 1bc8e1d..0c2e8e8 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetMetadataFacets.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetMetadataFacets.g.cs @@ -73,6 +73,28 @@ partial void ProcessGetMetadataFacetsResponseContent( /// public async global::System.Threading.Tasks.Task GetMetadataFacetsAsync( + global::Mixedbread.MetadataFacetsParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetMetadataFacetsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get metadata facets + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetMetadataFacetsAsResponseAsync( + global::Mixedbread.MetadataFacetsParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -107,6 +129,7 @@ partial void ProcessGetMetadataFacetsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/stores/metadata-facets", baseUri: ResolveBaseUri( @@ -188,6 +211,8 @@ partial void ProcessGetMetadataFacetsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +223,11 @@ partial void ProcessGetMetadataFacetsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +245,8 @@ partial void ProcessGetMetadataFacetsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +256,7 @@ partial void ProcessGetMetadataFacetsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +265,11 @@ partial void ProcessGetMetadataFacetsResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +286,15 @@ partial void ProcessGetMetadataFacetsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +334,8 @@ partial void ProcessGetMetadataFacetsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +356,8 @@ partial void ProcessGetMetadataFacetsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -379,9 +420,13 @@ partial void ProcessGetMetadataFacetsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MetadataFacets.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MetadataFacets.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -409,9 +454,13 @@ partial void ProcessGetMetadataFacetsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MetadataFacets.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MetadataFacets.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetStoreEventHistogram.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetStoreEventHistogram.g.cs index d0d13f5..c9fa6c3 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetStoreEventHistogram.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.GetStoreEventHistogram.g.cs @@ -85,6 +85,39 @@ partial void ProcessGetStoreEventHistogramResponseContent( public async global::System.Threading.Tasks.Task GetStoreEventHistogramAsync( global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.StoreEventHistogramParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetStoreEventHistogramAsResponseAsync( + storeIdentifier: storeIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get store event histogram
+ /// Get histogram of store events over time.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// histogram_params: Parameters for histogram generation.
+ /// Returns:
+ /// StoreEventHistogramResponse: The event histogram. + ///
+ /// + /// The ID or name of the store + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetStoreEventHistogramAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.StoreEventHistogramParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,6 +153,7 @@ partial void ProcessGetStoreEventHistogramResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/events/histogram", baseUri: ResolveBaseUri( @@ -202,6 +236,8 @@ partial void ProcessGetStoreEventHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessGetStoreEventHistogramResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessGetStoreEventHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessGetStoreEventHistogramResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessGetStoreEventHistogramResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessGetStoreEventHistogramResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessGetStoreEventHistogramResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessGetStoreEventHistogramResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -393,9 +445,13 @@ partial void ProcessGetStoreEventHistogramResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreEventHistogramResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreEventHistogramResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -423,9 +479,13 @@ partial void ProcessGetStoreEventHistogramResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreEventHistogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreEventHistogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreEvents.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreEvents.g.cs index b2b34ca..5e70d71 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreEvents.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreEvents.g.cs @@ -127,6 +127,71 @@ partial void ProcessListStoreEventsResponseContent( global::System.DateTime? filterAfter = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListStoreEventsAsResponseAsync( + storeIdentifier: storeIdentifier, + eventType: eventType, + limit: limit, + after: after, + before: before, + includeTotal: includeTotal, + filterBefore: filterBefore, + filterAfter: filterAfter, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List events for a store
+ /// List events for a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// options: The pagination options.
+ /// Returns:
+ /// StoreEventListResponse: The list of events for the store. + ///
+ /// + /// The ID or name of the store + /// + /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Time to filter events before + /// + /// + /// Time to filter events after + /// + /// + /// The type of event to list + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListStoreEventsAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.ListStoreEventsEventType eventType, + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + global::System.DateTime? filterBefore = default, + global::System.DateTime? filterAfter = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -163,11 +228,12 @@ partial void ProcessListStoreEventsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/events", baseUri: ResolveBaseUri( servers: s_ListStoreEventsServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -175,7 +241,7 @@ partial void ProcessListStoreEventsResponseContent( .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) .AddOptionalParameter("filter_before", filterBefore?.ToString()) .AddOptionalParameter("filter_after", filterAfter?.ToString()) - .AddRequiredParameter("event_type", eventType.ToValueString()) + .AddRequiredParameter("event_type", eventType.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -254,6 +320,8 @@ partial void ProcessListStoreEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -264,6 +332,11 @@ partial void ProcessListStoreEventsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -281,6 +354,8 @@ partial void ProcessListStoreEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -290,8 +365,7 @@ partial void ProcessListStoreEventsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +374,11 @@ partial void ProcessListStoreEventsResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -316,14 +395,15 @@ partial void ProcessListStoreEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -363,6 +443,8 @@ partial void ProcessListStoreEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -383,6 +465,8 @@ partial void ProcessListStoreEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -445,9 +529,13 @@ partial void ProcessListStoreEventsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreEventListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreEventListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -475,9 +563,13 @@ partial void ProcessListStoreEventsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreEventListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreEventListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreFilesWithMetadataFilter.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreFilesWithMetadataFilter.g.cs index db120fe..05fcb99 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreFilesWithMetadataFilter.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStoreFilesWithMetadataFilter.g.cs @@ -85,6 +85,39 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( public async global::System.Threading.Tasks.Task ListStoreFilesWithMetadataFilterAsync( global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.SearchCursorPagination request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListStoreFilesWithMetadataFilterAsResponseAsync( + storeIdentifier: storeIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List store files with metadata filter
+ /// List files indexed in a vector store with pagination and metadata filter.
+ /// Args:
+ /// vector_store_identifier: The ID or name of the vector store
+ /// pagination: Pagination parameters and metadata filter
+ /// Returns:
+ /// VectorStoreFileListResponse: Paginated list of vector store files + ///
+ /// + /// The ID or name of the store + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListStoreFilesWithMetadataFilterAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.SearchCursorPagination request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,6 +153,7 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/files/list", baseUri: ResolveBaseUri( @@ -202,6 +236,8 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -393,9 +445,13 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreFileListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreFileListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -423,9 +479,13 @@ partial void ProcessListStoreFilesWithMetadataFilterResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreFileListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreFileListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStores.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStores.g.cs index 8b99193..91a7ee1 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStores.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.ListStores.g.cs @@ -109,6 +109,56 @@ partial void ProcessListStoresResponseContent( string? q = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListStoresAsResponseAsync( + limit: limit, + after: after, + before: before, + includeTotal: includeTotal, + q: q, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List stores
+ /// List all stores with optional search.
+ /// Args:
+ /// pagination: The pagination options.
+ /// q: Optional search query to filter vector stores.
+ /// Returns:
+ /// StoreListResponse: The list of stores. + ///
+ /// + /// Maximum number of items to return per page (1-100)
+ /// Default Value: 20 + /// + /// + /// Cursor for forward pagination - get items after this position. Use last_cursor from previous response. + /// + /// + /// Cursor for backward pagination - get items before this position. Use first_cursor from previous response. + /// + /// + /// Whether to include total count in response (expensive operation)
+ /// Default Value: false + /// + /// + /// Search query for fuzzy matching over name and description fields + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListStoresAsResponseAsync( + int? limit = default, + string? after = default, + string? before = default, + bool? includeTotal = default, + string? q = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -142,17 +192,18 @@ partial void ProcessListStoresResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/stores", baseUri: ResolveBaseUri( servers: s_ListStoresServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) .AddOptionalParameter("before", before) .AddOptionalParameter("include_total", includeTotal?.ToString().ToLowerInvariant()) - .AddOptionalParameter("q", q) + .AddOptionalParameter("q", q) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -228,6 +279,8 @@ partial void ProcessListStoresResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -238,6 +291,11 @@ partial void ProcessListStoresResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -255,6 +313,8 @@ partial void ProcessListStoresResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -264,8 +324,7 @@ partial void ProcessListStoresResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -274,6 +333,11 @@ partial void ProcessListStoresResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -290,14 +354,15 @@ partial void ProcessListStoresResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -337,6 +402,8 @@ partial void ProcessListStoresResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -357,6 +424,8 @@ partial void ProcessListStoresResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -419,9 +488,13 @@ partial void ProcessListStoresResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -449,9 +522,13 @@ partial void ProcessListStoresResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveSearchRule.g.cs index 8c91013..fc7d4ea 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveSearchRule.g.cs @@ -89,6 +89,39 @@ partial void ProcessRetrieveSearchRuleResponseContent( global::System.Guid ruleId, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveSearchRuleAsResponseAsync( + storeIdentifier: storeIdentifier, + ruleId: ruleId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a search rule
+ /// Get a search rule by ID.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule to retrieve
+ /// Returns:
+ /// SearchRuleResponse: The search rule details + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,6 +152,7 @@ partial void ProcessRetrieveSearchRuleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/rules/{ruleId}", baseUri: ResolveBaseUri( @@ -195,6 +229,8 @@ partial void ProcessRetrieveSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +241,11 @@ partial void ProcessRetrieveSearchRuleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +263,8 @@ partial void ProcessRetrieveSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +274,7 @@ partial void ProcessRetrieveSearchRuleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +283,11 @@ partial void ProcessRetrieveSearchRuleResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +304,15 @@ partial void ProcessRetrieveSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +352,8 @@ partial void ProcessRetrieveSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +374,8 @@ partial void ProcessRetrieveSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +438,13 @@ partial void ProcessRetrieveSearchRuleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +472,13 @@ partial void ProcessRetrieveSearchRuleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStore.g.cs index a28cadd..ae0ae9b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStore.g.cs @@ -82,6 +82,33 @@ partial void ProcessRetrieveStoreResponseContent( global::Mixedbread.AnyOf storeIdentifier, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveStoreAsResponseAsync( + storeIdentifier: storeIdentifier, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a store
+ /// Get a store by ID or name.
+ /// Args:
+ /// store_identifier: The ID or name of the store to retrieve.
+ /// Returns:
+ /// Store: The response containing the store details. + ///
+ /// + /// The ID or name of the store + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveStoreAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,6 +138,7 @@ partial void ProcessRetrieveStoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessRetrieveStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessRetrieveStoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessRetrieveStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessRetrieveStoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessRetrieveStoreResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessRetrieveStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessRetrieveStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessRetrieveStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessRetrieveStoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.Store.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.Store.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessRetrieveStoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.Store.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.Store.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStoreFile.g.cs index 1722f5c..3216a7d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.RetrieveStoreFile.g.cs @@ -97,6 +97,46 @@ partial void ProcessRetrieveStoreFileResponseContent( global::Mixedbread.AnyOf>? returnChunks = default, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveStoreFileAsResponseAsync( + storeIdentifier: storeIdentifier, + fileIdentifier: fileIdentifier, + returnChunks: returnChunks, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get store file
+ /// Get a file from a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_id: The ID or name of the file.
+ /// options: Get file options.
+ /// Returns:
+ /// VectorStoreFile: The file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID or name of the file + /// + /// + /// Whether to return the chunks for the file. If a list of integers is provided, only the chunks at the specified indices will be returned.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AnyOf fileIdentifier, + global::Mixedbread.AnyOf>? returnChunks = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -128,13 +168,14 @@ partial void ProcessRetrieveStoreFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/files/{fileIdentifier}", baseUri: ResolveBaseUri( servers: s_RetrieveStoreFileServers, - defaultBaseUrl: "https://api.mixedbread.com/")); + defaultBaseUrl: "https://api.mixedbread.com/")); __pathBuilder - .AddOptionalParameter("return_chunks", returnChunks?.ToString()) + .AddOptionalParameter("return_chunks", returnChunks?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -208,6 +249,8 @@ partial void ProcessRetrieveStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -218,6 +261,11 @@ partial void ProcessRetrieveStoreFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -235,6 +283,8 @@ partial void ProcessRetrieveStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -244,8 +294,7 @@ partial void ProcessRetrieveStoreFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +303,11 @@ partial void ProcessRetrieveStoreFileResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -270,14 +324,15 @@ partial void ProcessRetrieveStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -317,6 +372,8 @@ partial void ProcessRetrieveStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -337,6 +394,8 @@ partial void ProcessRetrieveStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -399,9 +458,13 @@ partial void ProcessRetrieveStoreFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -429,9 +492,13 @@ partial void ProcessRetrieveStoreFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.SearchStoreChunks.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.SearchStoreChunks.g.cs index 62d9143..b54fb41 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.SearchStoreChunks.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.SearchStoreChunks.g.cs @@ -96,6 +96,51 @@ partial void ProcessSearchStoreChunksResponseContent( /// public async global::System.Threading.Tasks.Task SearchStoreChunksAsync( + global::Mixedbread.StoreChunkSearchParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchStoreChunksAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Perform semantic search across store chunks
+ /// Perform semantic search across store chunks.
+ /// This endpoint searches through store chunks using semantic similarity matching.
+ /// It supports complex search queries with filters and returns relevance-scored results.
+ /// For the special 'mixedbread/web' store, this endpoint performs web search using
+ /// a mixture of different providers instead of semantic search. Web search results are always
+ /// reranked for consistent scoring.
+ /// Args:
+ /// search_params: Search configuration including:
+ /// - query text or embeddings
+ /// - store_identifiers: List of store identifiers to search
+ /// - file_ids: Optional list of file IDs to filter chunks by (or tuple of list and condition operator)
+ /// - metadata filters
+ /// - pagination parameters
+ /// - sorting preferences
+ /// _state: API state dependency
+ /// _ctx: Service context dependency
+ /// Returns:
+ /// StoreSearchResponse containing:
+ /// - List of matched chunks with relevance scores
+ /// - Pagination details including total result count
+ /// Raises:
+ /// HTTPException (400): If search parameters are invalid
+ /// HTTPException (404): If no vector stores are found to search + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SearchStoreChunksAsResponseAsync( + global::Mixedbread.StoreChunkSearchParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -130,6 +175,7 @@ partial void ProcessSearchStoreChunksResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: "/v1/stores/search", baseUri: ResolveBaseUri( @@ -211,6 +257,8 @@ partial void ProcessSearchStoreChunksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +269,11 @@ partial void ProcessSearchStoreChunksResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +291,8 @@ partial void ProcessSearchStoreChunksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +302,7 @@ partial void ProcessSearchStoreChunksResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +311,11 @@ partial void ProcessSearchStoreChunksResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +332,15 @@ partial void ProcessSearchStoreChunksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +380,8 @@ partial void ProcessSearchStoreChunksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +402,8 @@ partial void ProcessSearchStoreChunksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -402,9 +466,13 @@ partial void ProcessSearchStoreChunksResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreSearchResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreSearchResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -432,9 +500,13 @@ partial void ProcessSearchStoreChunksResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreSearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreSearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateSearchRule.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateSearchRule.g.cs index 63a3092..e68fba6 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateSearchRule.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateSearchRule.g.cs @@ -92,6 +92,45 @@ partial void ProcessUpdateSearchRuleResponseContent( global::Mixedbread.AnyOf storeIdentifier, global::System.Guid ruleId, + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateSearchRuleAsResponseAsync( + storeIdentifier: storeIdentifier, + ruleId: ruleId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a search rule
+ /// Update a search rule by ID.
+ /// Args:
+ /// store_identifier: The ID or name of the store
+ /// rule_id: The ID of the search rule to update
+ /// rule_update: SearchRuleUpdateParams object containing the fields to update
+ /// Returns:
+ /// SearchRuleResponse: The updated search rule details + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID of the search rule to update + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateSearchRuleAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.Guid ruleId, + global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleUpdateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -128,6 +167,7 @@ partial void ProcessUpdateSearchRuleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/rules/{ruleId}", baseUri: ResolveBaseUri( @@ -211,6 +251,8 @@ partial void ProcessUpdateSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +263,11 @@ partial void ProcessUpdateSearchRuleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +285,8 @@ partial void ProcessUpdateSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +296,7 @@ partial void ProcessUpdateSearchRuleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +305,11 @@ partial void ProcessUpdateSearchRuleResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +326,15 @@ partial void ProcessUpdateSearchRuleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +374,8 @@ partial void ProcessUpdateSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +396,8 @@ partial void ProcessUpdateSearchRuleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -402,9 +460,13 @@ partial void ProcessUpdateSearchRuleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -432,9 +494,13 @@ partial void ProcessUpdateSearchRuleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.MxbaiOmniApiRoutesV1StoresRulesModelsSearchRuleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStore.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStore.g.cs index 13a4f5b..f790d58 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStore.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStore.g.cs @@ -85,6 +85,39 @@ partial void ProcessUpdateStoreResponseContent( public async global::System.Threading.Tasks.Task UpdateStoreAsync( global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.StoreUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateStoreAsResponseAsync( + storeIdentifier: storeIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a store
+ /// Update a store by ID or name.
+ /// Args:
+ /// store_identifier: The ID or name of the store to update.
+ /// store_update: StoreCreate object containing the name, description, and metadata.
+ /// Returns:
+ /// Store: The response containing the updated store details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateStoreAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.StoreUpdateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,6 +153,7 @@ partial void ProcessUpdateStoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}", baseUri: ResolveBaseUri( @@ -202,6 +236,8 @@ partial void ProcessUpdateStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +248,11 @@ partial void ProcessUpdateStoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +270,8 @@ partial void ProcessUpdateStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +281,7 @@ partial void ProcessUpdateStoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +290,11 @@ partial void ProcessUpdateStoreResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +311,15 @@ partial void ProcessUpdateStoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +359,8 @@ partial void ProcessUpdateStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +381,8 @@ partial void ProcessUpdateStoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -393,9 +445,13 @@ partial void ProcessUpdateStoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.Store.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.Store.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -423,9 +479,13 @@ partial void ProcessUpdateStoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.Store.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.Store.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStoreFile.g.cs index b4c9834..14d188b 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UpdateStoreFile.g.cs @@ -92,6 +92,45 @@ partial void ProcessUpdateStoreFileResponseContent( global::Mixedbread.AnyOf storeIdentifier, global::Mixedbread.AnyOf fileIdentifier, + global::Mixedbread.StoreFileMetadataUpdateParams request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateStoreFileAsResponseAsync( + storeIdentifier: storeIdentifier, + fileIdentifier: fileIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update store file metadata
+ /// Update metadata on a file within a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// file_identifier: The ID or name of the file to update.
+ /// update_params: Metadata update payload.
+ /// Returns:
+ /// StoreFile: The updated file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The ID or name of the file to update + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.AnyOf fileIdentifier, + global::Mixedbread.StoreFileMetadataUpdateParams request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -128,6 +167,7 @@ partial void ProcessUpdateStoreFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/files/{fileIdentifier}", baseUri: ResolveBaseUri( @@ -211,6 +251,8 @@ partial void ProcessUpdateStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +263,11 @@ partial void ProcessUpdateStoreFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +285,8 @@ partial void ProcessUpdateStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +296,7 @@ partial void ProcessUpdateStoreFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +305,11 @@ partial void ProcessUpdateStoreFileResponseContent( __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +326,15 @@ partial void ProcessUpdateStoreFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +374,8 @@ partial void ProcessUpdateStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +396,8 @@ partial void ProcessUpdateStoreFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -402,9 +460,13 @@ partial void ProcessUpdateStoreFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -432,9 +494,13 @@ partial void ProcessUpdateStoreFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UploadStoreFile.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UploadStoreFile.g.cs index e7ca660..b672e4d 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UploadStoreFile.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.UploadStoreFile.g.cs @@ -87,6 +87,41 @@ partial void ProcessUploadStoreFileResponseContent( public async global::System.Threading.Tasks.Task UploadStoreFileAsync( global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.BodyUploadStoreFile request, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadStoreFileAsResponseAsync( + storeIdentifier: storeIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload file via form to store
+ /// Upload a file via form to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// config: The config for the file.
+ /// metadata: The metadata for the file.
+ /// file: The file to upload.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::Mixedbread.BodyUploadStoreFile request, global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -118,10 +153,11 @@ partial void ProcessUploadStoreFileResponseContent( var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mixedbread.PathBuilder( path: $"/v1/stores/{storeIdentifier}/files/upload", baseUri: ResolveBaseUri( @@ -156,10 +192,12 @@ partial void ProcessUploadStoreFileResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(storeIdentifier.ToString() ?? string.Empty), name: "\"store_identifier\""); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( request.Filename is null @@ -197,14 +235,18 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + if (request.Params != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Params ?? string.Empty), name: "\"params\""); + } + __httpRequest.Content = __httpRequestContent; + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -247,6 +289,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -257,6 +301,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -274,6 +323,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -283,8 +334,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +343,11 @@ request.Filename is null __attempt < __maxAttempts && global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -309,14 +364,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -356,6 +412,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -376,6 +434,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -438,9 +498,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -468,9 +532,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -553,5 +621,974 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload file via form to store
+ /// Upload a file via form to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// config: The config for the file.
+ /// metadata: The metadata for the file.
+ /// file: The file to upload.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The file to upload and index + /// + /// + /// The file to upload and index + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UploadStoreFileAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.IO.Stream file, + string filename, + string? @params = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Mixedbread.BodyUploadStoreFile + { + File = global::System.Array.Empty(), + Filename = filename, + Params = @params, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadStoreFileArguments( + httpClient: HttpClient, + storeIdentifier: ref storeIdentifier, + request: request); + + + var __authorizations = global::Mixedbread.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadStoreFileSecurityRequirements, + operationName: "UploadStoreFileAsync"); + + using var __timeoutCancellationTokenSource = global::Mixedbread.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Mixedbread.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mixedbread.PathBuilder( + path: $"/v1/stores/{storeIdentifier}/files/upload", + baseUri: ResolveBaseUri( + servers: s_UploadStoreFileServers, + defaultBaseUrl: "https://api.mixedbread.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(storeIdentifier.ToString() ?? string.Empty), + name: "\"store_identifier\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Params != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Params ?? string.Empty), + name: "\"params\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadStoreFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + storeIdentifier: storeIdentifier!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadStoreFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Mixedbread.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Mixedbread.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadStoreFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upload file via form to store
+ /// Upload a file via form to a store.
+ /// Args:
+ /// store_identifier: The ID or name of the store.
+ /// config: The config for the file.
+ /// metadata: The metadata for the file.
+ /// file: The file to upload.
+ /// Returns:
+ /// VectorStoreFile: The uploaded file details. + ///
+ /// + /// The ID or name of the store + /// + /// + /// The file to upload and index + /// + /// + /// The file to upload and index + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadStoreFileAsResponseAsync( + global::Mixedbread.AnyOf storeIdentifier, + global::System.IO.Stream file, + string filename, + string? @params = default, + global::Mixedbread.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Mixedbread.BodyUploadStoreFile + { + File = global::System.Array.Empty(), + Filename = filename, + Params = @params, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadStoreFileArguments( + httpClient: HttpClient, + storeIdentifier: ref storeIdentifier, + request: request); + + + var __authorizations = global::Mixedbread.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadStoreFileSecurityRequirements, + operationName: "UploadStoreFileAsync"); + + using var __timeoutCancellationTokenSource = global::Mixedbread.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Mixedbread.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Mixedbread.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mixedbread.PathBuilder( + path: $"/v1/stores/{storeIdentifier}/files/upload", + baseUri: ResolveBaseUri( + servers: s_UploadStoreFileServers, + defaultBaseUrl: "https://api.mixedbread.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Mixedbread.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(storeIdentifier.ToString() ?? string.Empty), + name: "\"store_identifier\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Params != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Params ?? string.Empty), + name: "\"params\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Mixedbread.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadStoreFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + storeIdentifier: storeIdentifier!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Mixedbread.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Mixedbread.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Mixedbread.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadStoreFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Mixedbread.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Mixedbread.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadStoreFile", + methodName: "UploadStoreFileAsync", + pathTemplate: "$\"/v1/stores/{storeIdentifier}/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Mixedbread.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Mixedbread.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Mixedbread.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadStoreFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Mixedbread.StoreFile.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Mixedbread.StoreFile.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Mixedbread.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Mixedbread.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Mixedbread.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.g.cs b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.g.cs index 6de8625..5712c94 100644 --- a/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.g.cs +++ b/src/libs/Mixedbread/Generated/Mixedbread.StoresClient.g.cs @@ -113,10 +113,10 @@ public StoresClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public StoresClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Mixedbread.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Mixedbread.AutoSDKClientOptions? options, bool disposeHttpClient = true) {