From 97bb1fac2230670ff81c5dd2d200093dcf0bba2c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 May 2026 16:27:32 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/Writer.AutoSDKHttpResponse.g.cs | 37 +- ...riter.FileApiClient.GatewayDeleteFile.g.cs | 68 +++- ...ter.FileApiClient.GatewayDownloadFile.g.cs | 350 +++++++++++++++++- .../Writer.FileApiClient.GatewayGetFile.g.cs | 68 +++- .../Writer.FileApiClient.GatewayGetFiles.g.cs | 94 ++++- ...FileApiClient.GatewayRetryFailedFiles.g.cs | 72 +++- ...riter.FileApiClient.GatewayUploadFile.g.cs | 91 ++++- .../Generated/Writer.FileApiClient.g.cs | 8 +- .../Writer.GenerationApiClient.Chat.g.cs | 74 +++- ...iter.GenerationApiClient.ChatAsStream.g.cs | 29 +- ...riter.GenerationApiClient.Completions.g.cs | 74 +++- ...nerationApiClient.CompletionsAsStream.g.cs | 29 +- ...r.GenerationApiClient.GenerateContent.g.cs | 77 +++- ...tionApiClient.GenerateContentAsStream.g.cs | 29 +- ...r.GenerationApiClient.GetApplications.g.cs | 90 ++++- ...Client.GetApplicationsByApplicationId.g.cs | 68 +++- .../Writer.GenerationApiClient.Models.g.cs | 65 +++- .../Generated/Writer.GenerationApiClient.g.cs | 8 +- ...iter.IFileApiClient.GatewayDeleteFile.g.cs | 16 + ...er.IFileApiClient.GatewayDownloadFile.g.cs | 16 + .../Writer.IFileApiClient.GatewayGetFile.g.cs | 16 + ...Writer.IFileApiClient.GatewayGetFiles.g.cs | 32 ++ ...FileApiClient.GatewayRetryFailedFiles.g.cs | 19 + ...iter.IFileApiClient.GatewayUploadFile.g.cs | 30 ++ .../Writer.IGenerationApiClient.Chat.g.cs | 19 + ...iter.IGenerationApiClient.Completions.g.cs | 19 + ....IGenerationApiClient.GenerateContent.g.cs | 21 ++ ....IGenerationApiClient.GetApplications.g.cs | 30 ++ ...Client.GetApplicationsByApplicationId.g.cs | 16 + .../Writer.IGenerationApiClient.Models.g.cs | 14 + .../Writer.IKgApiClient.AddFileToGraph.g.cs | 21 ++ .../Writer.IKgApiClient.CreateGraph.g.cs | 19 + .../Writer.IKgApiClient.DeleteGraph.g.cs | 16 + ....IKgApiClient.FindGraphWithFileStatus.g.cs | 16 + ...IKgApiClient.FindGraphsWithFileStatus.g.cs | 26 ++ .../Writer.IKgApiClient.Question.g.cs | 19 + ...iter.IKgApiClient.RemoveFileFromGraph.g.cs | 18 + .../Writer.IKgApiClient.UpdateGraph.g.cs | 21 ++ ...CreateApplicationsByApplicationIdJobs.g.cs | 21 ++ ...nt.CreateApplicationsJobsByJobIdRetry.g.cs | 16 + ....GetApplicationsByApplicationIdGraphs.g.cs | 16 + ...nt.GetApplicationsByApplicationIdJobs.g.cs | 24 ++ ...lateClient.GetApplicationsJobsByJobId.g.cs | 16 + ....PutApplicationsByApplicationIdGraphs.g.cs | 21 ++ ...piClient.CreateToolsPdfParserByFileId.g.cs | 21 ++ ....IToolsApiClient.CreateToolsWebSearch.g.cs | 19 + ....ITranslationClient.CreateTranslation.g.cs | 19 + .../Writer.IVisionClient.CreateVision.g.cs | 19 + .../Writer.KgApiClient.AddFileToGraph.g.cs | 75 +++- .../Writer.KgApiClient.CreateGraph.g.cs | 72 +++- .../Writer.KgApiClient.DeleteGraph.g.cs | 68 +++- ...r.KgApiClient.FindGraphWithFileStatus.g.cs | 68 +++- ....KgApiClient.FindGraphsWithFileStatus.g.cs | 85 ++++- .../Writer.KgApiClient.Question.g.cs | 74 +++- .../Writer.KgApiClient.QuestionAsStream.g.cs | 29 +- ...riter.KgApiClient.RemoveFileFromGraph.g.cs | 71 +++- .../Writer.KgApiClient.UpdateGraph.g.cs | 75 +++- .../Writer/Generated/Writer.KgApiClient.g.cs | 8 +- .../Generated/Writer.OptionsSupport.g.cs | 231 +++++++++++- .../Generated/Writer.ResponseStream.g.cs | 117 ++++++ ...CreateApplicationsByApplicationIdJobs.g.cs | 75 +++- ...nt.CreateApplicationsJobsByJobIdRetry.g.cs | 68 +++- ....GetApplicationsByApplicationIdGraphs.g.cs | 68 +++- ...nt.GetApplicationsByApplicationIdJobs.g.cs | 83 ++++- ...lateClient.GetApplicationsJobsByJobId.g.cs | 68 +++- ....PutApplicationsByApplicationIdGraphs.g.cs | 75 +++- .../Generated/Writer.TemplateClient.g.cs | 8 +- ...piClient.CreateToolsPdfParserByFileId.g.cs | 75 +++- ...r.ToolsApiClient.CreateToolsWebSearch.g.cs | 74 +++- .../Generated/Writer.ToolsApiClient.g.cs | 8 +- ...r.TranslationClient.CreateTranslation.g.cs | 72 +++- .../Generated/Writer.TranslationClient.g.cs | 8 +- .../Writer.VisionClient.CreateVision.g.cs | 72 +++- .../Writer/Generated/Writer.VisionClient.g.cs | 8 +- .../Writer/Generated/Writer.WriterClient.g.cs | 22 +- 75 files changed, 3367 insertions(+), 317 deletions(-) create mode 100644 src/libs/Writer/Generated/Writer.ResponseStream.g.cs diff --git a/src/libs/Writer/Generated/Writer.AutoSDKHttpResponse.g.cs b/src/libs/Writer/Generated/Writer.AutoSDKHttpResponse.g.cs index 6b18d22..3274225 100644 --- a/src/libs/Writer/Generated/Writer.AutoSDKHttpResponse.g.cs +++ b/src/libs/Writer/Generated/Writer.AutoSDKHttpResponse.g.cs @@ -14,9 +14,24 @@ public partial class AutoSDKHttpResponse 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; } /// @@ -27,6 +42,10 @@ public AutoSDKHttpResponse( /// 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) @@ -73,7 +92,23 @@ public AutoSDKHttpResponse( global::System.Net.HttpStatusCode statusCode, global::System.Collections.Generic.Dictionary> headers, T body) - : base(statusCode, headers) + : 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; } diff --git a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDeleteFile.g.cs b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDeleteFile.g.cs index c1d78c0..0bae8fc 100644 --- a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDeleteFile.g.cs +++ b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDeleteFile.g.cs @@ -57,6 +57,31 @@ partial void ProcessGatewayDeleteFileResponseContent( string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GatewayDeleteFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete file
+ /// Permanently delete a file from the system. This action cannot be undone. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request DELETE https://api.writer.com/v1/files/{file_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GatewayDeleteFileAsResponseAsync( + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessGatewayDeleteFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/files/{fileId}", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessGatewayDeleteFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessGatewayDeleteFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessGatewayDeleteFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessGatewayDeleteFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessGatewayDeleteFileResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessGatewayDeleteFileResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessGatewayDeleteFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessGatewayDeleteFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessGatewayDeleteFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.DeleteFileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.DeleteFileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessGatewayDeleteFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.DeleteFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.DeleteFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDownloadFile.g.cs b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDownloadFile.g.cs index 4cafb45..4e60a4b 100644 --- a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDownloadFile.g.cs +++ b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayDownloadFile.g.cs @@ -78,7 +78,7 @@ partial void ProcessGatewayDownloadFileResponseContent( /// curl --location --request GET https://api.writer.com/v1/files/{file_id}/download \
/// --header "Authorization: Bearer <token>" /// - public async global::System.Threading.Tasks.Task> GatewayDownloadFileAsResponseAsync( + public async global::System.Threading.Tasks.Task GatewayDownloadFileAsStreamAsync( string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -111,6 +111,7 @@ partial void ProcessGatewayDownloadFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/files/{fileId}/download", baseUri: HttpClient.BaseAddress); @@ -184,16 +185,23 @@ partial void ProcessGatewayDownloadFileResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +219,8 @@ partial void ProcessGatewayDownloadFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +230,7 @@ partial void ProcessGatewayDownloadFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +239,11 @@ partial void ProcessGatewayDownloadFileResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +260,336 @@ partial void ProcessGatewayDownloadFileResponseContent( 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::Writer.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); + ProcessGatewayDownloadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Writer.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GatewayDownloadFile", + methodName: "GatewayDownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/download\"", + 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::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GatewayDownloadFile", + methodName: "GatewayDownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/download\"", + 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); + } + + try + { + __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::Writer.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::Writer.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 the binary content of a file. The response will contain the file data in the appropriate MIME type. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/files/{file_id}/download \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GatewayDownloadFileAsResponseAsync( + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGatewayDownloadFileArguments( + httpClient: HttpClient, + fileId: ref fileId); + + + var __authorizations = global::Writer.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GatewayDownloadFileSecurityRequirements, + operationName: "GatewayDownloadFileAsync"); + + using var __timeoutCancellationTokenSource = global::Writer.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Writer.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Writer.PathBuilder( + path: $"/v1/files/{fileId}/download", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Writer.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::Writer.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGatewayDownloadFileRequest( + 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::Writer.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GatewayDownloadFile", + methodName: "GatewayDownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/download\"", + 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::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GatewayDownloadFile", + methodName: "GatewayDownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/download\"", + 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( clientOptions: Options, requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GatewayDownloadFile", + methodName: "GatewayDownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/download\"", + 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +629,8 @@ partial void ProcessGatewayDownloadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +651,8 @@ partial void ProcessGatewayDownloadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -336,6 +676,7 @@ partial void ProcessGatewayDownloadFileResponseContent( return new global::Writer.AutoSDKHttpResponse( statusCode: __response.StatusCode, headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, body: __content); } catch (global::System.Exception __ex) @@ -366,6 +707,7 @@ partial void ProcessGatewayDownloadFileResponseContent( return new global::Writer.AutoSDKHttpResponse( statusCode: __response.StatusCode, headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, body: __content); } catch (global::System.Exception __ex) diff --git a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFile.g.cs b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFile.g.cs index 7f58e03..66b6c92 100644 --- a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFile.g.cs +++ b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFile.g.cs @@ -57,6 +57,31 @@ partial void ProcessGatewayGetFileResponseContent( string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GatewayGetFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve file
+ /// Retrieve detailed information about a specific file, including its metadata, status, and associated graphs. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/files/{file_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GatewayGetFileAsResponseAsync( + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessGatewayGetFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/files/{fileId}", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessGatewayGetFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessGatewayGetFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessGatewayGetFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessGatewayGetFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessGatewayGetFileResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessGatewayGetFileResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessGatewayGetFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessGatewayGetFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessGatewayGetFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.FileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.FileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessGatewayGetFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFiles.g.cs b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFiles.g.cs index df752d7..8eb9bbb 100644 --- a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFiles.g.cs +++ b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayGetFiles.g.cs @@ -85,6 +85,53 @@ partial void ProcessGatewayGetFilesResponseContent( string? fileTypes = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GatewayGetFilesAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + graphId: graphId, + status: status, + fileTypes: fileTypes, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List files
+ /// Retrieve a paginated list of files with optional filtering by status, graph association, and file type. + ///
+ /// + /// + /// + /// Default Value: 50 + /// + /// + /// Default Value: desc + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/files \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GatewayGetFilesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Writer.GatewayGetFilesOrder? order = default, + global::System.Guid? graphId = default, + global::Writer.GatewayGetFilesStatus? status = default, + string? fileTypes = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -120,9 +167,10 @@ partial void ProcessGatewayGetFilesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/files", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -130,7 +178,7 @@ partial void ProcessGatewayGetFilesResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("graph_id", graphId?.ToString()) .AddOptionalParameter("status", status?.ToValueString()) - .AddOptionalParameter("file_types", fileTypes) + .AddOptionalParameter("file_types", fileTypes) ; var __path = __pathBuilder.ToString(); __path = global::Writer.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -208,6 +256,8 @@ partial void ProcessGatewayGetFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -218,6 +268,11 @@ partial void ProcessGatewayGetFilesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -235,6 +290,8 @@ partial void ProcessGatewayGetFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -244,8 +301,7 @@ partial void ProcessGatewayGetFilesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -254,6 +310,11 @@ partial void ProcessGatewayGetFilesResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -270,14 +331,15 @@ partial void ProcessGatewayGetFilesResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -317,6 +379,8 @@ partial void ProcessGatewayGetFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -337,6 +401,8 @@ partial void ProcessGatewayGetFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -361,9 +427,13 @@ partial void ProcessGatewayGetFilesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.FilesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.FilesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +461,13 @@ partial void ProcessGatewayGetFilesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.FilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.FilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayRetryFailedFiles.g.cs b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayRetryFailedFiles.g.cs index 56f6f37..b7c8e11 100644 --- a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayRetryFailedFiles.g.cs +++ b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayRetryFailedFiles.g.cs @@ -57,6 +57,35 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( /// public async global::System.Threading.Tasks.Task GatewayRetryFailedFilesAsync( + global::Writer.RetryFilesRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GatewayRetryFailedFilesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retry failed files
+ /// Retry processing of files that previously failed to process. This will re-attempt the processing of the specified files. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/files/retry \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"file_ids":["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}' + ///
+ public async global::System.Threading.Tasks.Task> GatewayRetryFailedFilesAsResponseAsync( + global::Writer.RetryFilesRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +120,7 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/files/retry", baseUri: HttpClient.BaseAddress); @@ -170,6 +200,8 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +212,11 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +234,8 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +245,7 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +254,11 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +275,15 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +323,8 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +345,8 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +371,13 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.RetryFilesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.RetryFilesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +405,13 @@ partial void ProcessGatewayRetryFailedFilesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.RetryFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.RetryFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayUploadFile.g.cs b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayUploadFile.g.cs index b16e05a..74391ba 100644 --- a/src/libs/Writer/Generated/Writer.FileApiClient.GatewayUploadFile.g.cs +++ b/src/libs/Writer/Generated/Writer.FileApiClient.GatewayUploadFile.g.cs @@ -75,6 +75,50 @@ partial void ProcessGatewayUploadFileResponseContent( string contentType, long contentLength, + byte[] request, + global::System.Guid? graphId = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GatewayUploadFileAsResponseAsync( + contentDisposition: contentDisposition, + contentType: contentType, + contentLength: contentLength, + + request: request, + graphId: graphId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload file
+ /// Upload a new file to the system. Supports various file formats including PDF, DOC, DOCX, PPT, PPTX, JPG, PNG, EML, HTML, SRT, CSV, XLS, and XLSX. + ///
+ /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/files \
+ /// --header "Authorization: Bearer <token>"
+ /// --header "Accept: */*" \
+ /// --header "Content-Disposition: attachment; filename=descriptions.pdf" \
+ /// --header "Content-Length: size_in_bytes" \
+ /// --header "Content-Type: application/pdf" \
+ /// --data-binary "@descriptions.pdf" + ///
+ public async global::System.Threading.Tasks.Task> GatewayUploadFileAsResponseAsync( + string contentDisposition, + string contentType, + long contentLength, + byte[] request, global::System.Guid? graphId = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, @@ -114,11 +158,12 @@ partial void ProcessGatewayUploadFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/files", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("graphId", graphId?.ToString()) + .AddOptionalParameter("graphId", graphId?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Writer.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -203,6 +248,8 @@ partial void ProcessGatewayUploadFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -213,6 +260,11 @@ partial void ProcessGatewayUploadFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -230,6 +282,8 @@ partial void ProcessGatewayUploadFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -239,8 +293,7 @@ partial void ProcessGatewayUploadFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -249,6 +302,11 @@ partial void ProcessGatewayUploadFileResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -265,14 +323,15 @@ partial void ProcessGatewayUploadFileResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -312,6 +371,8 @@ partial void ProcessGatewayUploadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -332,6 +393,8 @@ partial void ProcessGatewayUploadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -356,9 +419,13 @@ partial void ProcessGatewayUploadFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.FileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.FileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -386,9 +453,13 @@ partial void ProcessGatewayUploadFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.FileApiClient.g.cs b/src/libs/Writer/Generated/Writer.FileApiClient.g.cs index ddfb01e..8bac955 100644 --- a/src/libs/Writer/Generated/Writer.FileApiClient.g.cs +++ b/src/libs/Writer/Generated/Writer.FileApiClient.g.cs @@ -72,10 +72,10 @@ public FileApiClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FileApiClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.Chat.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.Chat.g.cs index c16efdf..a882f81 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.Chat.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.Chat.g.cs @@ -57,6 +57,35 @@ partial void ProcessChatResponseContent( /// public async global::System.Threading.Tasks.Task ChatAsync( + global::Writer.ChatRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ChatAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Chat completion
+ /// Generate a chat completion based on the provided messages. The response shown below is for non-streaming. To learn about streaming responses, see the [chat completion guide](https://dev.writer.com/home/chat-completion). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/chat \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"palmyra-x5","messages":[{"content":"Write a memo summarizing this earnings report.","role":"user"}]}' + ///
+ public async global::System.Threading.Tasks.Task> ChatAsResponseAsync( + global::Writer.ChatRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,10 +132,11 @@ partial void ProcessChatResponseContent( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/chat", baseUri: HttpClient.BaseAddress); @@ -186,6 +216,8 @@ partial void ProcessChatResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +228,11 @@ partial void ProcessChatResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +250,8 @@ partial void ProcessChatResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +261,7 @@ partial void ProcessChatResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +270,11 @@ partial void ProcessChatResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +291,15 @@ partial void ProcessChatResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +339,8 @@ partial void ProcessChatResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +361,8 @@ partial void ProcessChatResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -339,9 +387,13 @@ partial void ProcessChatResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.ChatResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.ChatResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -369,9 +421,13 @@ partial void ProcessChatResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.ChatResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.ChatResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.ChatAsStream.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.ChatAsStream.g.cs index cf0a94d..776434a 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.ChatAsStream.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.ChatAsStream.g.cs @@ -98,10 +98,11 @@ partial void ProcessChatAsStreamResponse( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/chat", baseUri: HttpClient.BaseAddress); @@ -181,6 +182,8 @@ partial void ProcessChatAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +194,11 @@ partial void ProcessChatAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +216,8 @@ partial void ProcessChatAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +227,7 @@ partial void ProcessChatAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +236,11 @@ partial void ProcessChatAsStreamResponse( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +257,15 @@ partial void ProcessChatAsStreamResponse( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +305,8 @@ partial void ProcessChatAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +327,8 @@ partial void ProcessChatAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.Completions.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.Completions.g.cs index a7e110a..2f62357 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.Completions.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.Completions.g.cs @@ -57,6 +57,35 @@ partial void ProcessCompletionsResponseContent( /// public async global::System.Threading.Tasks.Task CompletionsAsync( + global::Writer.CompletionsRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CompletionsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Text generation
+ /// Generate text completions using the specified model and prompt. This endpoint is useful for text generation tasks that don't require conversational context. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/completions \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"palmyra-x-003-instruct","prompt":"Write me a short SEO article about camping gear","max_tokens":150,"temperature":0.7,"top_p":0.9,"stop":["."],"best_of":1,"random_seed":42,"stream":false}' + ///
+ public async global::System.Threading.Tasks.Task> CompletionsAsResponseAsync( + global::Writer.CompletionsRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -99,10 +128,11 @@ partial void ProcessCompletionsResponseContent( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/completions", baseUri: HttpClient.BaseAddress); @@ -182,6 +212,8 @@ partial void ProcessCompletionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +224,11 @@ partial void ProcessCompletionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +246,8 @@ partial void ProcessCompletionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +257,7 @@ partial void ProcessCompletionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +266,11 @@ partial void ProcessCompletionsResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +287,15 @@ partial void ProcessCompletionsResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +335,8 @@ partial void ProcessCompletionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +357,8 @@ partial void ProcessCompletionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -335,9 +383,13 @@ partial void ProcessCompletionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.CompletionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.CompletionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -365,9 +417,13 @@ partial void ProcessCompletionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.CompletionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.CompletionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.CompletionsAsStream.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.CompletionsAsStream.g.cs index bd826f4..ddd7bed 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.CompletionsAsStream.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.CompletionsAsStream.g.cs @@ -94,10 +94,11 @@ partial void ProcessCompletionsAsStreamResponse( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/completions", baseUri: HttpClient.BaseAddress); @@ -177,6 +178,8 @@ partial void ProcessCompletionsAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -187,6 +190,11 @@ partial void ProcessCompletionsAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -204,6 +212,8 @@ partial void ProcessCompletionsAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -213,8 +223,7 @@ partial void ProcessCompletionsAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -223,6 +232,11 @@ partial void ProcessCompletionsAsStreamResponse( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -239,14 +253,15 @@ partial void ProcessCompletionsAsStreamResponse( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -286,6 +301,8 @@ partial void ProcessCompletionsAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -306,6 +323,8 @@ partial void ProcessCompletionsAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContent.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContent.g.cs index 16a7113..7bf4580 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContent.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContent.g.cs @@ -61,6 +61,38 @@ partial void ProcessGenerateContentResponseContent( public async global::System.Threading.Tasks.Task GenerateContentAsync( global::System.Guid applicationId, + global::Writer.GenerateApplicationRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerateContentAsResponseAsync( + applicationId: applicationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate from application
+ /// Generate content from an existing no-code agent (formerly called no-code applications) with inputs. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/applications/{application_id} \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"inputs":[{"id": "Image ID", "value": ["12345"]}]}' + ///
+ public async global::System.Threading.Tasks.Task> GenerateContentAsResponseAsync( + global::System.Guid applicationId, + global::Writer.GenerateApplicationRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,10 +129,11 @@ partial void ProcessGenerateContentResponseContent( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/{applicationId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +214,8 @@ partial void ProcessGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +226,11 @@ partial void ProcessGenerateContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +248,8 @@ partial void ProcessGenerateContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +259,7 @@ partial void ProcessGenerateContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +268,11 @@ partial void ProcessGenerateContentResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +289,15 @@ partial void ProcessGenerateContentResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +337,8 @@ partial void ProcessGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +359,8 @@ partial void ProcessGenerateContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -334,9 +385,13 @@ partial void ProcessGenerateContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GenerateApplicationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GenerateApplicationResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -364,9 +419,13 @@ partial void ProcessGenerateContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GenerateApplicationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GenerateApplicationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContentAsStream.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContentAsStream.g.cs index 983a16e..00cbe21 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContentAsStream.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.GenerateContentAsStream.g.cs @@ -92,10 +92,11 @@ partial void ProcessGenerateContentAsStreamResponse( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/{applicationId}", baseUri: HttpClient.BaseAddress); @@ -176,6 +177,8 @@ partial void ProcessGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +189,11 @@ partial void ProcessGenerateContentAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +211,8 @@ partial void ProcessGenerateContentAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +222,7 @@ partial void ProcessGenerateContentAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +231,11 @@ partial void ProcessGenerateContentAsStreamResponse( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +252,15 @@ partial void ProcessGenerateContentAsStreamResponse( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +300,8 @@ partial void ProcessGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +322,8 @@ partial void ProcessGenerateContentAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplications.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplications.g.cs index f1e060d..f1ddfc9 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplications.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplications.g.cs @@ -79,6 +79,49 @@ partial void ProcessGetApplicationsResponseContent( global::Writer.ApplicationType? type = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApplicationsAsResponseAsync( + order: order, + before: before, + after: after, + limit: limit, + type: type, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List applications
+ /// Retrieves a paginated list of no-code agents (formerly called no-code applications) with optional filtering and sorting capabilities. + ///
+ /// + /// Default Value: desc + /// + /// + /// + /// + /// Default Value: 50 + /// + /// + /// The type of no-code application. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GetApplicationsAsResponseAsync( + global::Writer.GetApplicationsOrder? order = default, + global::System.Guid? before = default, + global::System.Guid? after = default, + int? limit = default, + global::Writer.ApplicationType? type = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,15 +155,16 @@ partial void ProcessGetApplicationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/applications", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("before", before?.ToString()) .AddOptionalParameter("after", after?.ToString()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("type", type?.ToValueString()) + .AddOptionalParameter("type", type?.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Writer.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -196,6 +240,8 @@ partial void ProcessGetApplicationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +252,11 @@ partial void ProcessGetApplicationsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -223,6 +274,8 @@ partial void ProcessGetApplicationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +285,7 @@ partial void ProcessGetApplicationsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +294,11 @@ partial void ProcessGetApplicationsResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -258,14 +315,15 @@ partial void ProcessGetApplicationsResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -305,6 +363,8 @@ partial void ProcessGetApplicationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +385,8 @@ partial void ProcessGetApplicationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -349,9 +411,13 @@ partial void ProcessGetApplicationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GetApplicationsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GetApplicationsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -379,9 +445,13 @@ partial void ProcessGetApplicationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GetApplicationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GetApplicationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplicationsByApplicationId.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplicationsByApplicationId.g.cs index 1d96232..02a4bae 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplicationsByApplicationId.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.GetApplicationsByApplicationId.g.cs @@ -57,6 +57,31 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( string applicationId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApplicationsByApplicationIdAsResponseAsync( + applicationId: applicationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Application details
+ /// Retrieves detailed information for a specific no-code agent (formerly called no-code applications), including its configuration and current status. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/{application_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GetApplicationsByApplicationIdAsResponseAsync( + string applicationId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/{applicationId}", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.ApplicationWithInputs.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.ApplicationWithInputs.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessGetApplicationsByApplicationIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.ApplicationWithInputs.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.ApplicationWithInputs.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.Models.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.Models.g.cs index 74eeafc..f4e230e 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.Models.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.Models.g.cs @@ -53,6 +53,28 @@ partial void ProcessModelsResponseContent( public async global::System.Threading.Tasks.Task ModelsAsync( global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List models
+ /// Retrieve a list of available models that can be used for text generation, chat completions, and other AI tasks. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/models \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> ModelsAsResponseAsync( + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +103,7 @@ partial void ProcessModelsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/models", baseUri: HttpClient.BaseAddress); @@ -153,6 +176,8 @@ partial void ProcessModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -163,6 +188,11 @@ partial void ProcessModelsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -180,6 +210,8 @@ partial void ProcessModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -189,8 +221,7 @@ partial void ProcessModelsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -199,6 +230,11 @@ partial void ProcessModelsResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -215,14 +251,15 @@ partial void ProcessModelsResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +299,8 @@ partial void ProcessModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -282,6 +321,8 @@ partial void ProcessModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -306,9 +347,13 @@ partial void ProcessModelsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.ModelsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.ModelsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -336,9 +381,13 @@ partial void ProcessModelsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.ModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.ModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.GenerationApiClient.g.cs b/src/libs/Writer/Generated/Writer.GenerationApiClient.g.cs index f18803b..246abb5 100644 --- a/src/libs/Writer/Generated/Writer.GenerationApiClient.g.cs +++ b/src/libs/Writer/Generated/Writer.GenerationApiClient.g.cs @@ -72,10 +72,10 @@ public GenerationApiClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public GenerationApiClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDeleteFile.g.cs b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDeleteFile.g.cs index cce911d..0795417 100644 --- a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDeleteFile.g.cs +++ b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDeleteFile.g.cs @@ -20,5 +20,21 @@ public partial interface IFileApiClient string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete file
+ /// Permanently delete a file from the system. This action cannot be undone. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request DELETE https://api.writer.com/v1/files/{file_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GatewayDeleteFileAsResponseAsync( + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDownloadFile.g.cs b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDownloadFile.g.cs index 7923621..21f1b8d 100644 --- a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDownloadFile.g.cs +++ b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayDownloadFile.g.cs @@ -32,6 +32,22 @@ public partial interface IFileApiClient /// curl --location --request GET https://api.writer.com/v1/files/{file_id}/download \
/// --header "Authorization: Bearer <token>" /// + global::System.Threading.Tasks.Task GatewayDownloadFileAsStreamAsync( + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download file
+ /// Download the binary content of a file. The response will contain the file data in the appropriate MIME type. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/files/{file_id}/download \
+ /// --header "Authorization: Bearer <token>" + ///
global::System.Threading.Tasks.Task> GatewayDownloadFileAsResponseAsync( string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFile.g.cs b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFile.g.cs index be92aec..3670e42 100644 --- a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFile.g.cs +++ b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFile.g.cs @@ -20,5 +20,21 @@ public partial interface IFileApiClient string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve file
+ /// Retrieve detailed information about a specific file, including its metadata, status, and associated graphs. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/files/{file_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GatewayGetFileAsResponseAsync( + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFiles.g.cs b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFiles.g.cs index 4a4d686..9be2b38 100644 --- a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFiles.g.cs +++ b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayGetFiles.g.cs @@ -36,5 +36,37 @@ public partial interface IFileApiClient string? fileTypes = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List files
+ /// Retrieve a paginated list of files with optional filtering by status, graph association, and file type. + ///
+ /// + /// + /// + /// Default Value: 50 + /// + /// + /// Default Value: desc + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/files \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GatewayGetFilesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Writer.GatewayGetFilesOrder? order = default, + global::System.Guid? graphId = default, + global::Writer.GatewayGetFilesStatus? status = default, + string? fileTypes = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayRetryFailedFiles.g.cs b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayRetryFailedFiles.g.cs index 1fd578e..ed27947 100644 --- a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayRetryFailedFiles.g.cs +++ b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayRetryFailedFiles.g.cs @@ -27,6 +27,25 @@ public partial interface IFileApiClient /// Retry failed files
/// Retry processing of files that previously failed to process. This will re-attempt the processing of the specified files. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/files/retry \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"file_ids":["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}' + ///
+ global::System.Threading.Tasks.Task> GatewayRetryFailedFilesAsResponseAsync( + + global::Writer.RetryFilesRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retry failed files
+ /// Retry processing of files that previously failed to process. This will re-attempt the processing of the specified files. + ///
/// /// The unique identifier of the files to retry. /// diff --git a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayUploadFile.g.cs b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayUploadFile.g.cs index d91e3a5..9d2b7ad 100644 --- a/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayUploadFile.g.cs +++ b/src/libs/Writer/Generated/Writer.IFileApiClient.GatewayUploadFile.g.cs @@ -30,6 +30,36 @@ public partial interface IFileApiClient string contentType, long contentLength, + byte[] request, + global::System.Guid? graphId = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload file
+ /// Upload a new file to the system. Supports various file formats including PDF, DOC, DOCX, PPT, PPTX, JPG, PNG, EML, HTML, SRT, CSV, XLS, and XLSX. + ///
+ /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/files \
+ /// --header "Authorization: Bearer <token>"
+ /// --header "Accept: */*" \
+ /// --header "Content-Disposition: attachment; filename=descriptions.pdf" \
+ /// --header "Content-Length: size_in_bytes" \
+ /// --header "Content-Type: application/pdf" \
+ /// --data-binary "@descriptions.pdf" + ///
+ global::System.Threading.Tasks.Task> GatewayUploadFileAsResponseAsync( + string contentDisposition, + string contentType, + long contentLength, + byte[] request, global::System.Guid? graphId = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Writer/Generated/Writer.IGenerationApiClient.Chat.g.cs b/src/libs/Writer/Generated/Writer.IGenerationApiClient.Chat.g.cs index ee25e45..c886311 100644 --- a/src/libs/Writer/Generated/Writer.IGenerationApiClient.Chat.g.cs +++ b/src/libs/Writer/Generated/Writer.IGenerationApiClient.Chat.g.cs @@ -27,6 +27,25 @@ public partial interface IGenerationApiClient /// Chat completion
/// Generate a chat completion based on the provided messages. The response shown below is for non-streaming. To learn about streaming responses, see the [chat completion guide](https://dev.writer.com/home/chat-completion). /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/chat \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"palmyra-x5","messages":[{"content":"Write a memo summarizing this earnings report.","role":"user"}]}' + ///
+ global::System.Threading.Tasks.Task> ChatAsResponseAsync( + + global::Writer.ChatRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Chat completion
+ /// Generate a chat completion based on the provided messages. The response shown below is for non-streaming. To learn about streaming responses, see the [chat completion guide](https://dev.writer.com/home/chat-completion). + ///
/// /// The [ID of the model](https://dev.writer.com/home/models) to use for creating the chat completion. Supports `palmyra-x5`, `palmyra-x4`, `palmyra-fin`, `palmyra-med`, `palmyra-creative`, and `palmyra-x-003-instruct`. /// diff --git a/src/libs/Writer/Generated/Writer.IGenerationApiClient.Completions.g.cs b/src/libs/Writer/Generated/Writer.IGenerationApiClient.Completions.g.cs index 6a02c61..393a6ae 100644 --- a/src/libs/Writer/Generated/Writer.IGenerationApiClient.Completions.g.cs +++ b/src/libs/Writer/Generated/Writer.IGenerationApiClient.Completions.g.cs @@ -27,6 +27,25 @@ public partial interface IGenerationApiClient /// Text generation
/// Generate text completions using the specified model and prompt. This endpoint is useful for text generation tasks that don't require conversational context. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/completions \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"palmyra-x-003-instruct","prompt":"Write me a short SEO article about camping gear","max_tokens":150,"temperature":0.7,"top_p":0.9,"stop":["."],"best_of":1,"random_seed":42,"stream":false}' + ///
+ global::System.Threading.Tasks.Task> CompletionsAsResponseAsync( + + global::Writer.CompletionsRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text generation
+ /// Generate text completions using the specified model and prompt. This endpoint is useful for text generation tasks that don't require conversational context. + ///
/// /// The [ID of the model](https://dev.writer.com/home/models) to use for generating text. Supports `palmyra-x5`, `palmyra-x4`, `palmyra-fin`, `palmyra-med`, `palmyra-creative`, and `palmyra-x-003-instruct`. /// diff --git a/src/libs/Writer/Generated/Writer.IGenerationApiClient.GenerateContent.g.cs b/src/libs/Writer/Generated/Writer.IGenerationApiClient.GenerateContent.g.cs index a7777c9..e0c0fa3 100644 --- a/src/libs/Writer/Generated/Writer.IGenerationApiClient.GenerateContent.g.cs +++ b/src/libs/Writer/Generated/Writer.IGenerationApiClient.GenerateContent.g.cs @@ -30,6 +30,27 @@ public partial interface IGenerationApiClient /// Generate content from an existing no-code agent (formerly called no-code applications) with inputs. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/applications/{application_id} \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"inputs":[{"id": "Image ID", "value": ["12345"]}]}' + ///
+ global::System.Threading.Tasks.Task> GenerateContentAsResponseAsync( + global::System.Guid applicationId, + + global::Writer.GenerateApplicationRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate from application
+ /// Generate content from an existing no-code agent (formerly called no-code applications) with inputs. + ///
+ /// /// /// 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/Writer/Generated/Writer.IGenerationApiClient.GetApplications.g.cs b/src/libs/Writer/Generated/Writer.IGenerationApiClient.GetApplications.g.cs index b76b6c5..8d86d21 100644 --- a/src/libs/Writer/Generated/Writer.IGenerationApiClient.GetApplications.g.cs +++ b/src/libs/Writer/Generated/Writer.IGenerationApiClient.GetApplications.g.cs @@ -34,5 +34,35 @@ public partial interface IGenerationApiClient global::Writer.ApplicationType? type = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List applications
+ /// Retrieves a paginated list of no-code agents (formerly called no-code applications) with optional filtering and sorting capabilities. + ///
+ /// + /// Default Value: desc + /// + /// + /// + /// + /// Default Value: 50 + /// + /// + /// The type of no-code application. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GetApplicationsAsResponseAsync( + global::Writer.GetApplicationsOrder? order = default, + global::System.Guid? before = default, + global::System.Guid? after = default, + int? limit = default, + global::Writer.ApplicationType? type = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IGenerationApiClient.GetApplicationsByApplicationId.g.cs b/src/libs/Writer/Generated/Writer.IGenerationApiClient.GetApplicationsByApplicationId.g.cs index 2f1dcf1..1fcbe58 100644 --- a/src/libs/Writer/Generated/Writer.IGenerationApiClient.GetApplicationsByApplicationId.g.cs +++ b/src/libs/Writer/Generated/Writer.IGenerationApiClient.GetApplicationsByApplicationId.g.cs @@ -20,5 +20,21 @@ public partial interface IGenerationApiClient string applicationId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Application details
+ /// Retrieves detailed information for a specific no-code agent (formerly called no-code applications), including its configuration and current status. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/{application_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GetApplicationsByApplicationIdAsResponseAsync( + string applicationId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IGenerationApiClient.Models.g.cs b/src/libs/Writer/Generated/Writer.IGenerationApiClient.Models.g.cs index 56f54a1..56d51d7 100644 --- a/src/libs/Writer/Generated/Writer.IGenerationApiClient.Models.g.cs +++ b/src/libs/Writer/Generated/Writer.IGenerationApiClient.Models.g.cs @@ -18,5 +18,19 @@ public partial interface IGenerationApiClient global::System.Threading.Tasks.Task ModelsAsync( global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List models
+ /// Retrieve a list of available models that can be used for text generation, chat completions, and other AI tasks. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/models \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> ModelsAsResponseAsync( + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.AddFileToGraph.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.AddFileToGraph.g.cs index bad5dd0..e8d890b 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.AddFileToGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.AddFileToGraph.g.cs @@ -30,6 +30,27 @@ public partial interface IKgApiClient /// Add a file to a Knowledge Graph. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/graphs/{graph_id}/file \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"file_id":"string"}' + ///
+ global::System.Threading.Tasks.Task> AddFileToGraphAsResponseAsync( + global::System.Guid graphId, + + global::Writer.GraphFileRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add file to graph
+ /// Add a file to a Knowledge Graph. + ///
+ /// /// /// The unique identifier of the file. /// diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.CreateGraph.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.CreateGraph.g.cs index 5c3065b..ec03786 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.CreateGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.CreateGraph.g.cs @@ -27,6 +27,25 @@ public partial interface IKgApiClient /// Create graph
/// Create a new Knowledge Graph. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/graphs \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"name":"string"}' + ///
+ global::System.Threading.Tasks.Task> CreateGraphAsResponseAsync( + + global::Writer.GraphRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create graph
+ /// Create a new Knowledge Graph. + ///
/// /// The name of the Knowledge Graph (max 255 characters). Omitting this field leaves the name unchanged. /// diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.DeleteGraph.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.DeleteGraph.g.cs index 4bb3870..47d84d4 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.DeleteGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.DeleteGraph.g.cs @@ -20,5 +20,21 @@ public partial interface IKgApiClient global::System.Guid graphId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete graph
+ /// Delete a Knowledge Graph. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request DELETE https://api.writer.com/v1/graphs/{graph_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> DeleteGraphAsResponseAsync( + global::System.Guid graphId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphWithFileStatus.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphWithFileStatus.g.cs index 8f634d1..9dcddd3 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphWithFileStatus.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphWithFileStatus.g.cs @@ -20,5 +20,21 @@ public partial interface IKgApiClient global::System.Guid graphId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve graph
+ /// Retrieve a Knowledge Graph. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/graphs/{graph_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> FindGraphWithFileStatusAsResponseAsync( + global::System.Guid graphId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphsWithFileStatus.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphsWithFileStatus.g.cs index b4e0370..2ede346 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphsWithFileStatus.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.FindGraphsWithFileStatus.g.cs @@ -30,5 +30,31 @@ public partial interface IKgApiClient int? limit = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List graphs
+ /// Retrieve a list of Knowledge Graphs. + ///
+ /// + /// Default Value: desc + /// + /// + /// + /// + /// Default Value: 50 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/graphs \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> FindGraphsWithFileStatusAsResponseAsync( + global::Writer.FindGraphsWithFileStatusOrder? order = default, + global::System.Guid? before = default, + global::System.Guid? after = default, + int? limit = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.Question.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.Question.g.cs index df926e4..85a76b1 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.Question.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.Question.g.cs @@ -27,6 +27,25 @@ public partial interface IKgApiClient /// Question
/// Ask a question to specified Knowledge Graphs. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/graphs/question \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"graph_ids":["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],"question":"What is the generic name for the drug Bavencio?"}' + ///
+ global::System.Threading.Tasks.Task> QuestionAsResponseAsync( + + global::Writer.QuestionRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Question
+ /// Ask a question to specified Knowledge Graphs. + ///
/// /// The unique identifiers of the Knowledge Graphs to query. /// diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.RemoveFileFromGraph.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.RemoveFileFromGraph.g.cs index 3e15565..dabe39f 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.RemoveFileFromGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.RemoveFileFromGraph.g.cs @@ -22,5 +22,23 @@ public partial interface IKgApiClient string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove file from graph
+ /// Remove a file from a Knowledge Graph. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request DELETE https://api.writer.com/v1/graphs/{graph_id}/file/{file_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> RemoveFileFromGraphAsResponseAsync( + global::System.Guid graphId, + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.IKgApiClient.UpdateGraph.g.cs b/src/libs/Writer/Generated/Writer.IKgApiClient.UpdateGraph.g.cs index e2a51a3..b248c49 100644 --- a/src/libs/Writer/Generated/Writer.IKgApiClient.UpdateGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.IKgApiClient.UpdateGraph.g.cs @@ -30,6 +30,27 @@ public partial interface IKgApiClient /// Update the name and description of a Knowledge Graph. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request PUT https://api.writer.com/v1/graphs/{graph_id} \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"name":"string", "description":"string", "urls":[{"url":"https://example.com/docs", "type":"sub_pages", "exclude_urls":["https://example.com/docs/private"]}]}' + ///
+ global::System.Threading.Tasks.Task> UpdateGraphAsResponseAsync( + global::System.Guid graphId, + + global::Writer.UpdateGraphRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update graph
+ /// Update the name and description of a Knowledge Graph. + ///
+ /// /// /// The name of the Knowledge Graph (max 255 characters). Omitting this field leaves the name unchanged. /// diff --git a/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsByApplicationIdJobs.g.cs b/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsByApplicationIdJobs.g.cs index a4469cd..ce7f5c0 100644 --- a/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsByApplicationIdJobs.g.cs +++ b/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsByApplicationIdJobs.g.cs @@ -30,6 +30,27 @@ public partial interface ITemplateClient /// Generate content asynchronously from an existing no-code agent (formerly called no-code applications) with inputs. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/applications/{application_id}/jobs \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"inputs":[{"id": "Image ID", "value": ["12345"]}]}' + ///
+ global::System.Threading.Tasks.Task> CreateApplicationsByApplicationIdJobsAsResponseAsync( + string applicationId, + + global::Writer.GenerateApplicationAsyncRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate from application (async)
+ /// Generate content asynchronously from an existing no-code agent (formerly called no-code applications) with inputs. + ///
+ /// /// /// A list of input objects to generate content for. /// diff --git a/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs b/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs index 53695b6..4bfd5ab 100644 --- a/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs +++ b/src/libs/Writer/Generated/Writer.ITemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs @@ -20,5 +20,21 @@ public partial interface ITemplateClient global::System.Guid jobId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retry job execution
+ /// Re-triggers the async execution of a single job previously created via the Async api and terminated in error. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/applications/jobs/{job_id}/retry \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> CreateApplicationsJobsByJobIdRetryAsResponseAsync( + global::System.Guid jobId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdGraphs.g.cs b/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdGraphs.g.cs index bed92fe..053cb4c 100644 --- a/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdGraphs.g.cs +++ b/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdGraphs.g.cs @@ -20,5 +20,21 @@ public partial interface ITemplateClient string applicationId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve graphs
+ /// Retrieve Knowledge Graphs associated with a no-code agent that has chat capabilities. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/{application_id}/graphs \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GetApplicationsByApplicationIdGraphsAsResponseAsync( + string applicationId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdJobs.g.cs b/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdJobs.g.cs index bb4358f..faeb710 100644 --- a/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdJobs.g.cs +++ b/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsByApplicationIdJobs.g.cs @@ -28,5 +28,29 @@ public partial interface ITemplateClient int? limit = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve all jobs
+ /// Retrieve all jobs created via the async API, linked to the provided application ID (or alias). + ///
+ /// + /// + /// The status of the job. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/{application_id}/jobs \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GetApplicationsByApplicationIdJobsAsResponseAsync( + string applicationId, + global::Writer.ApiJobStatus? status = default, + long? offset = default, + int? limit = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsJobsByJobId.g.cs b/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsJobsByJobId.g.cs index e2ee1df..332cad6 100644 --- a/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsJobsByJobId.g.cs +++ b/src/libs/Writer/Generated/Writer.ITemplateClient.GetApplicationsJobsByJobId.g.cs @@ -20,5 +20,21 @@ public partial interface ITemplateClient global::System.Guid jobId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve a single job
+ /// Retrieves a single job created via the Async API. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/jobs/{job_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ global::System.Threading.Tasks.Task> GetApplicationsJobsByJobIdAsResponseAsync( + global::System.Guid jobId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Writer/Generated/Writer.ITemplateClient.PutApplicationsByApplicationIdGraphs.g.cs b/src/libs/Writer/Generated/Writer.ITemplateClient.PutApplicationsByApplicationIdGraphs.g.cs index 8518dd1..2ef9111 100644 --- a/src/libs/Writer/Generated/Writer.ITemplateClient.PutApplicationsByApplicationIdGraphs.g.cs +++ b/src/libs/Writer/Generated/Writer.ITemplateClient.PutApplicationsByApplicationIdGraphs.g.cs @@ -30,6 +30,27 @@ public partial interface ITemplateClient /// Updates the list of Knowledge Graphs associated with a no-code chat agent. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request PUT https://api.writer.com/v1/applications/{application_id}/graphs \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"graph_ids":["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e","182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e","182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}' + ///
+ global::System.Threading.Tasks.Task> PutApplicationsByApplicationIdGraphsAsResponseAsync( + string applicationId, + + global::Writer.ApplicationGraphIdsRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Associate graphs
+ /// Updates the list of Knowledge Graphs associated with a no-code chat agent. + ///
+ /// /// /// A list of Knowledge Graph IDs to associate with the application. Note that this will replace the existing list of Knowledge Graphs associated with the application, not add to it. /// diff --git a/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsPdfParserByFileId.g.cs b/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsPdfParserByFileId.g.cs index cb60590..a695a53 100644 --- a/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsPdfParserByFileId.g.cs +++ b/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsPdfParserByFileId.g.cs @@ -30,6 +30,27 @@ public partial interface IToolsApiClient /// Parse PDF to other formats. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/tools/pdf-parser/{file_id} \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"format":"text"}' + ///
+ global::System.Threading.Tasks.Task> CreateToolsPdfParserByFileIdAsResponseAsync( + string fileId, + + global::Writer.ParsePdfRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Parse PDF
+ /// Parse PDF to other formats. + ///
+ /// /// /// The format into which the PDF content should be converted. /// diff --git a/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsWebSearch.g.cs b/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsWebSearch.g.cs index 0890a83..82ab02d 100644 --- a/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsWebSearch.g.cs +++ b/src/libs/Writer/Generated/Writer.IToolsApiClient.CreateToolsWebSearch.g.cs @@ -27,6 +27,25 @@ public partial interface IToolsApiClient /// Web search
/// Search the web for information about a given query and return relevant results with source URLs. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/tools/web-search \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"query":"How do I get an API key for the Writer API?","include_domains":["dev.writer.com"]}' + ///
+ global::System.Threading.Tasks.Task> CreateToolsWebSearchAsResponseAsync( + + global::Writer.WebSearchRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Web search
+ /// Search the web for information about a given query and return relevant results with source URLs. + ///
/// /// The search query. /// diff --git a/src/libs/Writer/Generated/Writer.ITranslationClient.CreateTranslation.g.cs b/src/libs/Writer/Generated/Writer.ITranslationClient.CreateTranslation.g.cs index 9015087..0e3f136 100644 --- a/src/libs/Writer/Generated/Writer.ITranslationClient.CreateTranslation.g.cs +++ b/src/libs/Writer/Generated/Writer.ITranslationClient.CreateTranslation.g.cs @@ -27,6 +27,25 @@ public partial interface ITranslationClient /// Translate text
/// Translate text from one language to another. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/translation \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"string","source_language_code":"string","target_language_code":"string","text":"string","formality":false,"length_control":false,"mask_profanity":false}' + ///
+ global::System.Threading.Tasks.Task> CreateTranslationAsResponseAsync( + + global::Writer.TranslationRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Translate text
+ /// Translate text from one language to another. + ///
/// /// The model to use for translation. /// diff --git a/src/libs/Writer/Generated/Writer.IVisionClient.CreateVision.g.cs b/src/libs/Writer/Generated/Writer.IVisionClient.CreateVision.g.cs index 786b1f3..def11af 100644 --- a/src/libs/Writer/Generated/Writer.IVisionClient.CreateVision.g.cs +++ b/src/libs/Writer/Generated/Writer.IVisionClient.CreateVision.g.cs @@ -27,6 +27,25 @@ public partial interface IVisionClient /// Analyze images
/// Submit images and documents with a prompt to generate an analysis. Supports JPG, PNG, PDF, and TXT files up to 7MB each. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/vision \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"palmyra-vision","variables":[{"name":"image_1","file_id":"f1234"},{"name":"image_2","file_id":"f9876"}],"prompt":"Describe the difference between the image {{image_1}} and the image {{image_2}}."}' + ///
+ global::System.Threading.Tasks.Task> CreateVisionAsResponseAsync( + + global::Writer.VisionRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analyze images
+ /// Submit images and documents with a prompt to generate an analysis. Supports JPG, PNG, PDF, and TXT files up to 7MB each. + ///
/// /// The model to use for image analysis. /// diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.AddFileToGraph.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.AddFileToGraph.g.cs index aa78a1e..45b5ed0 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.AddFileToGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.AddFileToGraph.g.cs @@ -61,6 +61,38 @@ partial void ProcessAddFileToGraphResponseContent( public async global::System.Threading.Tasks.Task AddFileToGraphAsync( global::System.Guid graphId, + global::Writer.GraphFileRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddFileToGraphAsResponseAsync( + graphId: graphId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add file to graph
+ /// Add a file to a Knowledge Graph. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/graphs/{graph_id}/file \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"file_id":"string"}' + ///
+ public async global::System.Threading.Tasks.Task> AddFileToGraphAsResponseAsync( + global::System.Guid graphId, + global::Writer.GraphFileRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -96,6 +128,7 @@ partial void ProcessAddFileToGraphResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/graphs/{graphId}/file", baseUri: HttpClient.BaseAddress); @@ -176,6 +209,8 @@ partial void ProcessAddFileToGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +221,11 @@ partial void ProcessAddFileToGraphResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +243,8 @@ partial void ProcessAddFileToGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +254,7 @@ partial void ProcessAddFileToGraphResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +263,11 @@ partial void ProcessAddFileToGraphResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +284,15 @@ partial void ProcessAddFileToGraphResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +332,8 @@ partial void ProcessAddFileToGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +354,8 @@ partial void ProcessAddFileToGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +380,13 @@ partial void ProcessAddFileToGraphResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.FileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.FileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +414,13 @@ partial void ProcessAddFileToGraphResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.CreateGraph.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.CreateGraph.g.cs index 4a782aa..dd51fc6 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.CreateGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.CreateGraph.g.cs @@ -57,6 +57,35 @@ partial void ProcessCreateGraphResponseContent( /// public async global::System.Threading.Tasks.Task CreateGraphAsync( + global::Writer.GraphRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateGraphAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create graph
+ /// Create a new Knowledge Graph. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/graphs \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"name":"string"}' + ///
+ public async global::System.Threading.Tasks.Task> CreateGraphAsResponseAsync( + global::Writer.GraphRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +120,7 @@ partial void ProcessCreateGraphResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/graphs", baseUri: HttpClient.BaseAddress); @@ -170,6 +200,8 @@ partial void ProcessCreateGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +212,11 @@ partial void ProcessCreateGraphResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +234,8 @@ partial void ProcessCreateGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +245,7 @@ partial void ProcessCreateGraphResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +254,11 @@ partial void ProcessCreateGraphResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +275,15 @@ partial void ProcessCreateGraphResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +323,8 @@ partial void ProcessCreateGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +345,8 @@ partial void ProcessCreateGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +371,13 @@ partial void ProcessCreateGraphResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GraphResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GraphResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +405,13 @@ partial void ProcessCreateGraphResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GraphResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GraphResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.DeleteGraph.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.DeleteGraph.g.cs index 8d8ea08..fac7daf 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.DeleteGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.DeleteGraph.g.cs @@ -57,6 +57,31 @@ partial void ProcessDeleteGraphResponseContent( global::System.Guid graphId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteGraphAsResponseAsync( + graphId: graphId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete graph
+ /// Delete a Knowledge Graph. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request DELETE https://api.writer.com/v1/graphs/{graph_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> DeleteGraphAsResponseAsync( + global::System.Guid graphId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessDeleteGraphResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/graphs/{graphId}", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessDeleteGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessDeleteGraphResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessDeleteGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessDeleteGraphResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessDeleteGraphResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessDeleteGraphResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessDeleteGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessDeleteGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessDeleteGraphResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.DeleteGraphResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.DeleteGraphResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessDeleteGraphResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.DeleteGraphResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.DeleteGraphResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphWithFileStatus.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphWithFileStatus.g.cs index 7ef4c1a..07215bc 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphWithFileStatus.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphWithFileStatus.g.cs @@ -57,6 +57,31 @@ partial void ProcessFindGraphWithFileStatusResponseContent( global::System.Guid graphId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FindGraphWithFileStatusAsResponseAsync( + graphId: graphId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve graph
+ /// Retrieve a Knowledge Graph. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/graphs/{graph_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> FindGraphWithFileStatusAsResponseAsync( + global::System.Guid graphId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessFindGraphWithFileStatusResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/graphs/{graphId}", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessFindGraphWithFileStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessFindGraphWithFileStatusResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessFindGraphWithFileStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessFindGraphWithFileStatusResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessFindGraphWithFileStatusResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessFindGraphWithFileStatusResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessFindGraphWithFileStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessFindGraphWithFileStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessFindGraphWithFileStatusResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.Graph.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.Graph.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessFindGraphWithFileStatusResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.Graph.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.Graph.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphsWithFileStatus.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphsWithFileStatus.g.cs index e3625e4..a41dc89 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphsWithFileStatus.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.FindGraphsWithFileStatus.g.cs @@ -73,6 +73,44 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( int? limit = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FindGraphsWithFileStatusAsResponseAsync( + order: order, + before: before, + after: after, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List graphs
+ /// Retrieve a list of Knowledge Graphs. + ///
+ /// + /// Default Value: desc + /// + /// + /// + /// + /// Default Value: 50 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/graphs \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> FindGraphsWithFileStatusAsResponseAsync( + global::Writer.FindGraphsWithFileStatusOrder? order = default, + global::System.Guid? before = default, + global::System.Guid? after = default, + int? limit = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,14 +143,15 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/graphs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("before", before?.ToString()) .AddOptionalParameter("after", after?.ToString()) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Writer.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -187,6 +226,8 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +238,11 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +260,8 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +271,7 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +280,11 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +301,15 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +349,8 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +371,8 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -340,9 +397,13 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GraphsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GraphsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -370,9 +431,13 @@ partial void ProcessFindGraphsWithFileStatusResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GraphsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GraphsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.Question.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.Question.g.cs index 32f8f08..1540ab7 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.Question.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.Question.g.cs @@ -57,6 +57,35 @@ partial void ProcessQuestionResponseContent( /// public async global::System.Threading.Tasks.Task QuestionAsync( + global::Writer.QuestionRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await QuestionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Question
+ /// Ask a question to specified Knowledge Graphs. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/graphs/question \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"graph_ids":["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],"question":"What is the generic name for the drug Bavencio?"}' + ///
+ public async global::System.Threading.Tasks.Task> QuestionAsResponseAsync( + global::Writer.QuestionRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -95,10 +124,11 @@ partial void ProcessQuestionResponseContent( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/graphs/question", baseUri: HttpClient.BaseAddress); @@ -178,6 +208,8 @@ partial void ProcessQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +220,11 @@ partial void ProcessQuestionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +242,8 @@ partial void ProcessQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +253,7 @@ partial void ProcessQuestionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +262,11 @@ partial void ProcessQuestionResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +283,15 @@ partial void ProcessQuestionResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +331,8 @@ partial void ProcessQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +353,8 @@ partial void ProcessQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -331,9 +379,13 @@ partial void ProcessQuestionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.QuestionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.QuestionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -361,9 +413,13 @@ partial void ProcessQuestionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.QuestionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.QuestionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.QuestionAsStream.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.QuestionAsStream.g.cs index 72f5e53..2e11867 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.QuestionAsStream.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.QuestionAsStream.g.cs @@ -90,10 +90,11 @@ partial void ProcessQuestionAsStreamResponse( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/graphs/question", baseUri: HttpClient.BaseAddress); @@ -173,6 +174,8 @@ partial void ProcessQuestionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +186,11 @@ partial void ProcessQuestionAsStreamResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +208,8 @@ partial void ProcessQuestionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +219,7 @@ partial void ProcessQuestionAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +228,11 @@ partial void ProcessQuestionAsStreamResponse( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +249,15 @@ partial void ProcessQuestionAsStreamResponse( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +297,8 @@ partial void ProcessQuestionAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +319,8 @@ partial void ProcessQuestionAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.RemoveFileFromGraph.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.RemoveFileFromGraph.g.cs index e542d74..986c11c 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.RemoveFileFromGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.RemoveFileFromGraph.g.cs @@ -61,6 +61,34 @@ partial void ProcessRemoveFileFromGraphResponseContent( string fileId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RemoveFileFromGraphAsResponseAsync( + graphId: graphId, + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remove file from graph
+ /// Remove a file from a Knowledge Graph. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request DELETE https://api.writer.com/v1/graphs/{graph_id}/file/{file_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> RemoveFileFromGraphAsResponseAsync( + global::System.Guid graphId, + string fileId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -91,6 +119,7 @@ partial void ProcessRemoveFileFromGraphResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/graphs/{graphId}/file/{fileId}", baseUri: HttpClient.BaseAddress); @@ -165,6 +194,8 @@ partial void ProcessRemoveFileFromGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +206,11 @@ partial void ProcessRemoveFileFromGraphResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -192,6 +228,8 @@ partial void ProcessRemoveFileFromGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -201,8 +239,7 @@ partial void ProcessRemoveFileFromGraphResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -211,6 +248,11 @@ partial void ProcessRemoveFileFromGraphResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -227,14 +269,15 @@ partial void ProcessRemoveFileFromGraphResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -274,6 +317,8 @@ partial void ProcessRemoveFileFromGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +339,8 @@ partial void ProcessRemoveFileFromGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -318,9 +365,13 @@ partial void ProcessRemoveFileFromGraphResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.DeleteFileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.DeleteFileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -348,9 +399,13 @@ partial void ProcessRemoveFileFromGraphResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.DeleteFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.DeleteFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.UpdateGraph.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.UpdateGraph.g.cs index efb5993..547239d 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.UpdateGraph.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.UpdateGraph.g.cs @@ -61,6 +61,38 @@ partial void ProcessUpdateGraphResponseContent( public async global::System.Threading.Tasks.Task UpdateGraphAsync( global::System.Guid graphId, + global::Writer.UpdateGraphRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateGraphAsResponseAsync( + graphId: graphId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update graph
+ /// Update the name and description of a Knowledge Graph. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request PUT https://api.writer.com/v1/graphs/{graph_id} \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"name":"string", "description":"string", "urls":[{"url":"https://example.com/docs", "type":"sub_pages", "exclude_urls":["https://example.com/docs/private"]}]}' + ///
+ public async global::System.Threading.Tasks.Task> UpdateGraphAsResponseAsync( + global::System.Guid graphId, + global::Writer.UpdateGraphRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -96,6 +128,7 @@ partial void ProcessUpdateGraphResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/graphs/{graphId}", baseUri: HttpClient.BaseAddress); @@ -176,6 +209,8 @@ partial void ProcessUpdateGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +221,11 @@ partial void ProcessUpdateGraphResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +243,8 @@ partial void ProcessUpdateGraphResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +254,7 @@ partial void ProcessUpdateGraphResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +263,11 @@ partial void ProcessUpdateGraphResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +284,15 @@ partial void ProcessUpdateGraphResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +332,8 @@ partial void ProcessUpdateGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +354,8 @@ partial void ProcessUpdateGraphResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +380,13 @@ partial void ProcessUpdateGraphResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GraphResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GraphResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +414,13 @@ partial void ProcessUpdateGraphResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GraphResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GraphResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.KgApiClient.g.cs b/src/libs/Writer/Generated/Writer.KgApiClient.g.cs index 4e37243..872828b 100644 --- a/src/libs/Writer/Generated/Writer.KgApiClient.g.cs +++ b/src/libs/Writer/Generated/Writer.KgApiClient.g.cs @@ -72,10 +72,10 @@ public KgApiClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public KgApiClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Writer/Generated/Writer.OptionsSupport.g.cs b/src/libs/Writer/Generated/Writer.OptionsSupport.g.cs index 7590dd6..8f762ea 100644 --- a/src/libs/Writer/Generated/Writer.OptionsSupport.g.cs +++ b/src/libs/Writer/Generated/Writer.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::Writer.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::Writer.AutoSDKClientOptions clientOptions, global::Writer.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Writer.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::Writer.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/Writer/Generated/Writer.ResponseStream.g.cs b/src/libs/Writer/Generated/Writer.ResponseStream.g.cs new file mode 100644 index 0000000..3cf53d0 --- /dev/null +++ b/src/libs/Writer/Generated/Writer.ResponseStream.g.cs @@ -0,0 +1,117 @@ + +#nullable enable + +namespace Writer +{ + 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/Writer/Generated/Writer.TemplateClient.CreateApplicationsByApplicationIdJobs.g.cs b/src/libs/Writer/Generated/Writer.TemplateClient.CreateApplicationsByApplicationIdJobs.g.cs index 2e3ddd2..fa4372e 100644 --- a/src/libs/Writer/Generated/Writer.TemplateClient.CreateApplicationsByApplicationIdJobs.g.cs +++ b/src/libs/Writer/Generated/Writer.TemplateClient.CreateApplicationsByApplicationIdJobs.g.cs @@ -61,6 +61,38 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( public async global::System.Threading.Tasks.Task CreateApplicationsByApplicationIdJobsAsync( string applicationId, + global::Writer.GenerateApplicationAsyncRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateApplicationsByApplicationIdJobsAsResponseAsync( + applicationId: applicationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate from application (async)
+ /// Generate content asynchronously from an existing no-code agent (formerly called no-code applications) with inputs. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/applications/{application_id}/jobs \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"inputs":[{"id": "Image ID", "value": ["12345"]}]}' + ///
+ public async global::System.Threading.Tasks.Task> CreateApplicationsByApplicationIdJobsAsResponseAsync( + string applicationId, + global::Writer.GenerateApplicationAsyncRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -96,6 +128,7 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/{applicationId}/jobs", baseUri: HttpClient.BaseAddress); @@ -176,6 +209,8 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +221,11 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +243,8 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +254,7 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +263,11 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +284,15 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +332,8 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +354,8 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +380,13 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GenerateApplicationAsyncResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GenerateApplicationAsyncResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +414,13 @@ partial void ProcessCreateApplicationsByApplicationIdJobsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GenerateApplicationAsyncResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GenerateApplicationAsyncResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.TemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs b/src/libs/Writer/Generated/Writer.TemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs index 94cbe47..8bc5ab8 100644 --- a/src/libs/Writer/Generated/Writer.TemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs +++ b/src/libs/Writer/Generated/Writer.TemplateClient.CreateApplicationsJobsByJobIdRetry.g.cs @@ -57,6 +57,31 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( global::System.Guid jobId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateApplicationsJobsByJobIdRetryAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retry job execution
+ /// Re-triggers the async execution of a single job previously created via the Async api and terminated in error. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/applications/jobs/{job_id}/retry \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> CreateApplicationsJobsByJobIdRetryAsResponseAsync( + global::System.Guid jobId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/jobs/{jobId}/retry", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GenerateApplicationAsyncResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GenerateApplicationAsyncResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessCreateApplicationsJobsByJobIdRetryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GenerateApplicationAsyncResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GenerateApplicationAsyncResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdGraphs.g.cs b/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdGraphs.g.cs index 6370476..ba1d085 100644 --- a/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdGraphs.g.cs +++ b/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdGraphs.g.cs @@ -57,6 +57,31 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( string applicationId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApplicationsByApplicationIdGraphsAsResponseAsync( + applicationId: applicationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve graphs
+ /// Retrieve Knowledge Graphs associated with a no-code agent that has chat capabilities. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/{application_id}/graphs \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GetApplicationsByApplicationIdGraphsAsResponseAsync( + string applicationId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/{applicationId}/graphs", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.ApplicationGraphsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.ApplicationGraphsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessGetApplicationsByApplicationIdGraphsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.ApplicationGraphsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.ApplicationGraphsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdJobs.g.cs b/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdJobs.g.cs index 4ca8eb1..7a5a997 100644 --- a/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdJobs.g.cs +++ b/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsByApplicationIdJobs.g.cs @@ -71,6 +71,42 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( int? limit = default, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApplicationsByApplicationIdJobsAsResponseAsync( + applicationId: applicationId, + status: status, + offset: offset, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve all jobs
+ /// Retrieve all jobs created via the async API, linked to the provided application ID (or alias). + ///
+ /// + /// + /// The status of the job. + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/{application_id}/jobs \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GetApplicationsByApplicationIdJobsAsResponseAsync( + string applicationId, + global::Writer.ApiJobStatus? status = default, + long? offset = default, + int? limit = default, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -103,13 +139,14 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/{applicationId}/jobs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("status", status?.ToValueString()) .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Writer.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -184,6 +221,8 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +233,11 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +255,8 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +266,7 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +275,11 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +296,15 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +344,8 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +366,8 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -337,9 +392,13 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GetAsyncApplicationJobsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GetAsyncApplicationJobsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -367,9 +426,13 @@ partial void ProcessGetApplicationsByApplicationIdJobsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GetAsyncApplicationJobsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GetAsyncApplicationJobsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsJobsByJobId.g.cs b/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsJobsByJobId.g.cs index 8a019ab..4146a8d 100644 --- a/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsJobsByJobId.g.cs +++ b/src/libs/Writer/Generated/Writer.TemplateClient.GetApplicationsJobsByJobId.g.cs @@ -57,6 +57,31 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( global::System.Guid jobId, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApplicationsJobsByJobIdAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve a single job
+ /// Retrieves a single job created via the Async API. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request GET https://api.writer.com/v1/applications/jobs/{job_id} \
+ /// --header "Authorization: Bearer <token>" + ///
+ public async global::System.Threading.Tasks.Task> GetApplicationsJobsByJobIdAsResponseAsync( + global::System.Guid jobId, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/jobs/{jobId}", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,8 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -195,8 +230,7 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,15 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -312,9 +356,13 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.GetAsyncApplicationJobResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.GetAsyncApplicationJobResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -342,9 +390,13 @@ partial void ProcessGetApplicationsJobsByJobIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.GetAsyncApplicationJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.GetAsyncApplicationJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.TemplateClient.PutApplicationsByApplicationIdGraphs.g.cs b/src/libs/Writer/Generated/Writer.TemplateClient.PutApplicationsByApplicationIdGraphs.g.cs index 2a9473f..3d05a9b 100644 --- a/src/libs/Writer/Generated/Writer.TemplateClient.PutApplicationsByApplicationIdGraphs.g.cs +++ b/src/libs/Writer/Generated/Writer.TemplateClient.PutApplicationsByApplicationIdGraphs.g.cs @@ -61,6 +61,38 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( public async global::System.Threading.Tasks.Task PutApplicationsByApplicationIdGraphsAsync( string applicationId, + global::Writer.ApplicationGraphIdsRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutApplicationsByApplicationIdGraphsAsResponseAsync( + applicationId: applicationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Associate graphs
+ /// Updates the list of Knowledge Graphs associated with a no-code chat agent. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request PUT https://api.writer.com/v1/applications/{application_id}/graphs \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"graph_ids":["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e","182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e","182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]}' + ///
+ public async global::System.Threading.Tasks.Task> PutApplicationsByApplicationIdGraphsAsResponseAsync( + string applicationId, + global::Writer.ApplicationGraphIdsRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -96,6 +128,7 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/applications/{applicationId}/graphs", baseUri: HttpClient.BaseAddress); @@ -176,6 +209,8 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +221,11 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +243,8 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +254,7 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +263,11 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +284,15 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +332,8 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +354,8 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +380,13 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.ApplicationGraphsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.ApplicationGraphsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +414,13 @@ partial void ProcessPutApplicationsByApplicationIdGraphsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.ApplicationGraphsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.ApplicationGraphsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.TemplateClient.g.cs b/src/libs/Writer/Generated/Writer.TemplateClient.g.cs index 6119945..a05378f 100644 --- a/src/libs/Writer/Generated/Writer.TemplateClient.g.cs +++ b/src/libs/Writer/Generated/Writer.TemplateClient.g.cs @@ -72,10 +72,10 @@ public TemplateClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public TemplateClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsPdfParserByFileId.g.cs b/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsPdfParserByFileId.g.cs index 57424ae..6d34c16 100644 --- a/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsPdfParserByFileId.g.cs +++ b/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsPdfParserByFileId.g.cs @@ -61,6 +61,38 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( public async global::System.Threading.Tasks.Task CreateToolsPdfParserByFileIdAsync( string fileId, + global::Writer.ParsePdfRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateToolsPdfParserByFileIdAsResponseAsync( + fileId: fileId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Parse PDF
+ /// Parse PDF to other formats. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/tools/pdf-parser/{file_id} \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"format":"text"}' + ///
+ public async global::System.Threading.Tasks.Task> CreateToolsPdfParserByFileIdAsResponseAsync( + string fileId, + global::Writer.ParsePdfRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -96,6 +128,7 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: $"/v1/tools/pdf-parser/{fileId}", baseUri: HttpClient.BaseAddress); @@ -176,6 +209,8 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +221,11 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +243,8 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +254,7 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +263,11 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +284,15 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +332,8 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +354,8 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +380,13 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.ParsePdfResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.ParsePdfResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +414,13 @@ partial void ProcessCreateToolsPdfParserByFileIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.ParsePdfResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.ParsePdfResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsWebSearch.g.cs b/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsWebSearch.g.cs index 6d1d785..0419ed2 100644 --- a/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsWebSearch.g.cs +++ b/src/libs/Writer/Generated/Writer.ToolsApiClient.CreateToolsWebSearch.g.cs @@ -57,6 +57,35 @@ partial void ProcessCreateToolsWebSearchResponseContent( /// public async global::System.Threading.Tasks.Task CreateToolsWebSearchAsync( + global::Writer.WebSearchRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateToolsWebSearchAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Web search
+ /// Search the web for information about a given query and return relevant results with source URLs. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/tools/web-search \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"query":"How do I get an API key for the Writer API?","include_domains":["dev.writer.com"]}' + ///
+ public async global::System.Threading.Tasks.Task> CreateToolsWebSearchAsResponseAsync( + global::Writer.WebSearchRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -87,10 +116,11 @@ partial void ProcessCreateToolsWebSearchResponseContent( var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/tools/web-search", baseUri: HttpClient.BaseAddress); @@ -170,6 +200,8 @@ partial void ProcessCreateToolsWebSearchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +212,11 @@ partial void ProcessCreateToolsWebSearchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +234,8 @@ partial void ProcessCreateToolsWebSearchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +245,7 @@ partial void ProcessCreateToolsWebSearchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +254,11 @@ partial void ProcessCreateToolsWebSearchResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +275,15 @@ partial void ProcessCreateToolsWebSearchResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +323,8 @@ partial void ProcessCreateToolsWebSearchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +345,8 @@ partial void ProcessCreateToolsWebSearchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +371,13 @@ partial void ProcessCreateToolsWebSearchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.WebSearchResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.WebSearchResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +405,13 @@ partial void ProcessCreateToolsWebSearchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.WebSearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.WebSearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.ToolsApiClient.g.cs b/src/libs/Writer/Generated/Writer.ToolsApiClient.g.cs index 50b12cd..5ebd65e 100644 --- a/src/libs/Writer/Generated/Writer.ToolsApiClient.g.cs +++ b/src/libs/Writer/Generated/Writer.ToolsApiClient.g.cs @@ -72,10 +72,10 @@ public ToolsApiClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ToolsApiClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Writer/Generated/Writer.TranslationClient.CreateTranslation.g.cs b/src/libs/Writer/Generated/Writer.TranslationClient.CreateTranslation.g.cs index c4ed5ab..b04c5ae 100644 --- a/src/libs/Writer/Generated/Writer.TranslationClient.CreateTranslation.g.cs +++ b/src/libs/Writer/Generated/Writer.TranslationClient.CreateTranslation.g.cs @@ -57,6 +57,35 @@ partial void ProcessCreateTranslationResponseContent( /// public async global::System.Threading.Tasks.Task CreateTranslationAsync( + global::Writer.TranslationRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateTranslationAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Translate text
+ /// Translate text from one language to another. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/translation \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"string","source_language_code":"string","target_language_code":"string","text":"string","formality":false,"length_control":false,"mask_profanity":false}' + ///
+ public async global::System.Threading.Tasks.Task> CreateTranslationAsResponseAsync( + global::Writer.TranslationRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +120,7 @@ partial void ProcessCreateTranslationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/translation", baseUri: HttpClient.BaseAddress); @@ -170,6 +200,8 @@ partial void ProcessCreateTranslationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +212,11 @@ partial void ProcessCreateTranslationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +234,8 @@ partial void ProcessCreateTranslationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +245,7 @@ partial void ProcessCreateTranslationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +254,11 @@ partial void ProcessCreateTranslationResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +275,15 @@ partial void ProcessCreateTranslationResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +323,8 @@ partial void ProcessCreateTranslationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +345,8 @@ partial void ProcessCreateTranslationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +371,13 @@ partial void ProcessCreateTranslationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.TranslationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.TranslationResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +405,13 @@ partial void ProcessCreateTranslationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.TranslationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.TranslationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.TranslationClient.g.cs b/src/libs/Writer/Generated/Writer.TranslationClient.g.cs index 22abe38..e11d441 100644 --- a/src/libs/Writer/Generated/Writer.TranslationClient.g.cs +++ b/src/libs/Writer/Generated/Writer.TranslationClient.g.cs @@ -72,10 +72,10 @@ public TranslationClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public TranslationClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Writer/Generated/Writer.VisionClient.CreateVision.g.cs b/src/libs/Writer/Generated/Writer.VisionClient.CreateVision.g.cs index 30b8855..3036987 100644 --- a/src/libs/Writer/Generated/Writer.VisionClient.CreateVision.g.cs +++ b/src/libs/Writer/Generated/Writer.VisionClient.CreateVision.g.cs @@ -57,6 +57,35 @@ partial void ProcessCreateVisionResponseContent( /// public async global::System.Threading.Tasks.Task CreateVisionAsync( + global::Writer.VisionRequest request, + global::Writer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVisionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analyze images
+ /// Submit images and documents with a prompt to generate an analysis. Supports JPG, PNG, PDF, and TXT files up to 7MB each. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --location --request POST https://api.writer.com/v1/vision \
+ /// --header "Authorization: Bearer <token>" \
+ /// --header "Content-Type: application/json" \
+ /// --data-raw '{"model":"palmyra-vision","variables":[{"name":"image_1","file_id":"f1234"},{"name":"image_2","file_id":"f9876"}],"prompt":"Describe the difference between the image {{image_1}} and the image {{image_2}}."}' + ///
+ public async global::System.Threading.Tasks.Task> CreateVisionAsResponseAsync( + global::Writer.VisionRequest request, global::Writer.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +120,7 @@ partial void ProcessCreateVisionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Writer.PathBuilder( path: "/v1/vision", baseUri: HttpClient.BaseAddress); @@ -170,6 +200,8 @@ partial void ProcessCreateVisionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +212,11 @@ partial void ProcessCreateVisionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +234,8 @@ partial void ProcessCreateVisionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +245,7 @@ partial void ProcessCreateVisionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +254,11 @@ partial void ProcessCreateVisionResponseContent( __attempt < __maxAttempts && global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +275,15 @@ partial void ProcessCreateVisionResponseContent( 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::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +323,8 @@ partial void ProcessCreateVisionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +345,8 @@ partial void ProcessCreateVisionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +371,13 @@ partial void ProcessCreateVisionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Writer.VisionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Writer.VisionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +405,13 @@ partial void ProcessCreateVisionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Writer.VisionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Writer.VisionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Writer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Writer/Generated/Writer.VisionClient.g.cs b/src/libs/Writer/Generated/Writer.VisionClient.g.cs index 52ce9e1..862ba5f 100644 --- a/src/libs/Writer/Generated/Writer.VisionClient.g.cs +++ b/src/libs/Writer/Generated/Writer.VisionClient.g.cs @@ -72,10 +72,10 @@ public VisionClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public VisionClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Writer/Generated/Writer.WriterClient.g.cs b/src/libs/Writer/Generated/Writer.WriterClient.g.cs index 006453f..064a624 100644 --- a/src/libs/Writer/Generated/Writer.WriterClient.g.cs +++ b/src/libs/Writer/Generated/Writer.WriterClient.g.cs @@ -42,7 +42,7 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global: /// /// /// - public FileApiClient FileApi => new FileApiClient(HttpClient, authorizations: Authorizations, options: Options) + public FileApiClient FileApi => new FileApiClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -51,7 +51,7 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global: /// /// /// - public GenerationApiClient GenerationApi => new GenerationApiClient(HttpClient, authorizations: Authorizations, options: Options) + public GenerationApiClient GenerationApi => new GenerationApiClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -60,7 +60,7 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global: /// /// /// - public KgApiClient KgApi => new KgApiClient(HttpClient, authorizations: Authorizations, options: Options) + public KgApiClient KgApi => new KgApiClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -69,7 +69,7 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global: /// /// /// - public TemplateClient Template => new TemplateClient(HttpClient, authorizations: Authorizations, options: Options) + public TemplateClient Template => new TemplateClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -78,7 +78,7 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global: /// /// /// - public ToolsApiClient ToolsApi => new ToolsApiClient(HttpClient, authorizations: Authorizations, options: Options) + public ToolsApiClient ToolsApi => new ToolsApiClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -87,7 +87,7 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global: /// /// /// - public TranslationClient Translation => new TranslationClient(HttpClient, authorizations: Authorizations, options: Options) + public TranslationClient Translation => new TranslationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -96,7 +96,7 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global: /// /// /// - public VisionClient Vision => new VisionClient(HttpClient, authorizations: Authorizations, options: Options) + public VisionClient Vision => new VisionClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -135,10 +135,10 @@ public WriterClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public WriterClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Writer.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Writer.AutoSDKClientOptions? options, bool disposeHttpClient = true) {