diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs index 3516b31f..c7ffea90 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs @@ -25,6 +25,7 @@ public void AuthorizeUsingBearer( Authorizations.Add(new global::AI21.EndPointAuthorization { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", Value = apiKey, diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs index ab08e11b..f18f2aa1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( /// Can Iframe /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CanIframeStudioV1DemosScraperCanIframeGetAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CanIframeStudioV1DemosScraperCanIframeGetAsResponseAsync( + url: url, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Can Iframe + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CanIframeStudioV1DemosScraperCanIframeGetAsResponseAsync( + string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( securityRequirements: s_CanIframeStudioV1DemosScraperCanIframeGetSecurityRequirements, operationName: "CanIframeStudioV1DemosScraperCanIframeGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/scraper/can-iframe", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("url", url) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/scraper/can-iframe", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("url", url) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCanIframeStudioV1DemosScraperCanIframeGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - url: url); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCanIframeStudioV1DemosScraperCanIframeGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + url: url!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCanIframeStudioV1DemosScraperCanIframeGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( + response: __response); + ProcessCanIframeStudioV1DemosScraperCanIframeGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs deleted file mode 100644 index e44727f9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirement0, - }; - partial void PrepareClarotyProductLookupSolutionsClarotyProductLookupPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareClarotyProductLookupSolutionsClarotyProductLookupPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Claroty Product Lookup - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ClarotyProductLookupSolutionsClarotyProductLookupPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareClarotyProductLookupSolutionsClarotyProductLookupPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirements, - operationName: "ClarotyProductLookupSolutionsClarotyProductLookupPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/claroty/product-lookup", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareClarotyProductLookupSolutionsClarotyProductLookupPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs deleted file mode 100644 index 3c130729..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirement0, - }; - partial void PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Claroty Scrape Url - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirements, - operationName: "ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/claroty/scrape-url", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs deleted file mode 100644 index 24e94abe..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirement0, - }; - partial void PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Claroty Suggest Vendor Model - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirements, - operationName: "ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/claroty/suggest-vendor-model", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs index b0a8a53e..7575ad31 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo /// Compare text in a document file against a reference text. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CompareTextStudioV1DemosDocumentModifierCompareTextPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Compare Text
+ /// Compare text in a document file against a reference text. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CompareTextStudioV1DemosDocumentModifierCompareTextPostAsResponseAsync( + + global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo securityRequirements: s_CompareTextStudioV1DemosDocumentModifierCompareTextPostSecurityRequirements, operationName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/compare-text", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/compare-text", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,152 +139,332 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCompareTextStudioV1DemosDocumentModifierCompareTextPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCompareTextStudioV1DemosDocumentModifierCompareTextPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponseContent( + response: __response); + ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Compare Text
@@ -244,11 +472,13 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( string originalText, string modifiedText, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CompareTextRequest @@ -259,6 +489,7 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo return await CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs index bdb1f7c5..5fdbcbdd 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs @@ -26,5 +26,6 @@ partial void Authorizing( ref string apiKey); partial void Authorized( global::System.Net.Http.HttpClient client); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 25e41545..fb421d0b 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte /// Convert Document File /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Convert Document File + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + + global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte securityRequirements: s_ConvertDocumentFileStudioV1ChatFilesConvertPostSecurityRequirements, operationName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/chat/files/convert", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/files/convert", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,179 +137,1267 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++) - { - var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]); - __httpRequestContent.Add( - content: __contentFiles, - name: "\"files\"", - fileName: $"\"file{__iFiles}.bin\""); - if (__contentFiles.Headers.ContentDisposition != null) - { - __contentFiles.Headers.ContentDisposition.FileNameStar = null; - } + } } - __httpRequest.Content = __httpRequestContent; - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++) + { + var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"file{__iFiles}.bin\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + __httpRequest.Content = __httpRequestContent; - ProcessResponse( - client: HttpClient, - response: __response); - ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + response: __response); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Convert Document File + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + global::System.Collections.Generic.IList files, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost + { + Files = files, + }; + + return await ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Convert Document File + /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + files = files ?? throw new global::System.ArgumentNullException(nameof(files)); + var request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost + { + Files = new global::System.Collections.Generic.List(), + }; + PrepareArguments( + client: HttpClient); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ConvertDocumentFileStudioV1ChatFilesConvertPostSecurityRequirements, + operationName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/files/convert", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - ).ConfigureAwait(false); - return __content; + 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); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") { - string? __content = null; + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); } } /// /// Convert Document File /// - /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( - global::System.Collections.Generic.IList files, + /// + public async global::System.Threading.Tasks.Task> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost + + files = files ?? throw new global::System.ArgumentNullException(nameof(files)); + var request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost { - Files = files, + Files = new global::System.Collections.Generic.List(), }; + PrepareArguments( + client: HttpClient); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostArguments( + httpClient: HttpClient, + request: request); - return await ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ConvertDocumentFileStudioV1ChatFilesConvertPostSecurityRequirements, + operationName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/files/convert", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs index 82d02f97..9cd6d98c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( /// Create a new demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDemoStudioV1DemosPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Demo
+ /// Create a new demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDemoStudioV1DemosPostAsResponseAsync( + + global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( securityRequirements: s_CreateDemoStudioV1DemosPostSecurityRequirements, operationName: "CreateDemoStudioV1DemosPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,156 +139,336 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateDemoStudioV1DemosPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDemoStudioV1DemosPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateDemoStudioV1DemosPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateDemoStudioV1DemosPostResponseContent( + response: __response); + ProcessCreateDemoStudioV1DemosPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDemoStudioV1DemosPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Demo
@@ -261,6 +489,7 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( @@ -269,6 +498,7 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( global::AI21.DemoStatus status, string uiComponentName, object? config = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DemoCreate @@ -282,6 +512,7 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( return await CreateDemoStudioV1DemosPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs index 82e8f25b..264cf555 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( /// Create Mcp Storage ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateMcpStorageStudioV1McpStoragePostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateMcpStorageStudioV1McpStoragePostAsResponseAsync( + + global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( securityRequirements: s_CreateMcpStorageStudioV1McpStoragePostSecurityRequirements, operationName: "CreateMcpStorageStudioV1McpStoragePostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/mcp/storage", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/mcp/storage", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,156 +137,336 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateMcpStorageStudioV1McpStoragePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateMcpStorageStudioV1McpStoragePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateMcpStorageStudioV1McpStoragePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( + response: __response); + ProcessCreateMcpStorageStudioV1McpStoragePostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Mcp Storage @@ -253,6 +480,7 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( @@ -263,6 +491,7 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( string? authHeaderName = default, string? authValue = default, global::System.Collections.Generic.IList? allowedTools = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateMCPStorageRequest @@ -278,6 +507,7 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( return await CreateMcpStorageStudioV1McpStoragePostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs index 8e7b1304..fa2efeac 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( string organizationId, global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsResponseAsync( + organizationId: organizationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Organization Schema + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsResponseAsync( + string organizationId, + + global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr securityRequirements: s_CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostSecurityRequirements, operationName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,153 +145,333 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponseContent( + response: __response); + ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Organization Schema @@ -252,6 +482,7 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr /// /// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( @@ -259,6 +490,7 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr string schemaName, object schemaObject, bool? runClassification = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateOrganizationSchemaRequest @@ -271,6 +503,7 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr return await CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( organizationId: organizationId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs index c66cb5ab..f6bf9abd 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( /// Delete a demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteDemoStudioV1DemosDemoIdDeleteAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteDemoStudioV1DemosDemoIdDeleteAsResponseAsync( + demoId: demoId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Demo
+ /// Delete a demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteDemoStudioV1DemosDemoIdDeleteAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( securityRequirements: s_DeleteDemoStudioV1DemosDemoIdDeleteSecurityRequirements, operationName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/{demoId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/{demoId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,146 +134,326 @@ partial void ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteDemoStudioV1DemosDemoIdDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - demoId: demoId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteDemoStudioV1DemosDemoIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + demoId: demoId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "DELETE", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( + response: __response); + ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs index 1c3f4391..66e3bf28 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent /// Delete Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsResponseAsync( + mcpId: mcpId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent securityRequirements: s_DeleteMcpStorageStudioV1McpStorageMcpIdDeleteSecurityRequirements, operationName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteMcpStorageStudioV1McpStorageMcpIdDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteMcpStorageStudioV1McpStorageMcpIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "DELETE", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent( + response: __response); + ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.DeleteMCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.DeleteMCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.DeleteMCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.DeleteMCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs index 642c70a4..2c5addc4 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOr /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync( string organizationId, string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsResponseAsync( + organizationId: organizationId, + schemaName: schemaName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Organization Schema + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsResponseAsync( + string organizationId, + string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOr securityRequirements: s_DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteSecurityRequirements, operationName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,147 +140,327 @@ partial void ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOr __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - schemaName: schemaName); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + schemaName: schemaName!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponseContent( + response: __response); + ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs index 2576f925..254cdeea 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDe /// Delete Website Connector /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync( string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsResponseAsync( + connectorId: connectorId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Website Connector + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsResponseAsync( + string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDe securityRequirements: s_DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteSecurityRequirements, operationName: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/website/{connectorId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/website/{connectorId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,146 +132,326 @@ partial void ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDe __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - connectorId: connectorId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + connectorId: connectorId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete", + methodName: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete", + methodName: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + httpMethod: "DELETE", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete", + methodName: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponseContent( + response: __response); + ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete", + methodName: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete", + methodName: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs index e0de2153..7844bcc1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete /// Delete Workspace Model Endpoint /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync( string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsResponseAsync( + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Workspace Model Endpoint + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsResponseAsync( + string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete securityRequirements: s_DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteSecurityRequirements, operationName: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/settings/models/{name}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/settings/models/{name}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,146 +132,326 @@ partial void ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete", + methodName: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete", + methodName: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "DELETE", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete", + methodName: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponseContent( + response: __response); + ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete", + methodName: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete", + methodName: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs index 3d21597f..2263f799 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsResponseAsync( + organizationId: organizationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detect Schema + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsResponseAsync( + string organizationId, + + global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId securityRequirements: s_DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostSecurityRequirements, operationName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponseContent( + response: __response); + ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.DetectSchemaResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.DetectSchemaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.DetectSchemaResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.DetectSchemaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Detect Schema @@ -253,12 +483,14 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::System.Collections.Generic.IList documents, global::System.Collections.Generic.IList? queries = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DetectSchemaRequest @@ -270,6 +502,7 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId return await DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( organizationId: organizationId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs index 80eb9870..ec967fa7 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa /// Download a modified document. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Download Modified Document
+ /// Download a modified document. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsResponseAsync( + + global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa securityRequirements: s_DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostSecurityRequirements, operationName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/download", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/download", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,152 +139,332 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponseContent( + response: __response); + ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Download Modified Document
@@ -244,11 +472,13 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( string content, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DownloadModifiedDocumentRequest @@ -259,6 +489,7 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa return await DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index 6668d609..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirements, - operationName: "FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fd_aftersales/parts-classification/batch", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index a1acc9b3..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirements, - operationName: "FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fd_aftersales/parts-classification/batch", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index ebc139d9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements, - operationName: "FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index f250d687..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict Status - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements, - operationName: "FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 12e14f5e..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirements, - operationName: "FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fd/batches/v1/classifications", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index e97db143..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/results", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index 5b6a29c9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Results - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/classifications/{batchId}/results", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 0ca47c65..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirements, - operationName: "FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fd/batches/v1/classifications", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index 5c451fd6..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index 35659cde..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Status - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/classifications/{batchId}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index 9e577387..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fd/batches/v1/descriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 6d8bcb7f..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 19aad154..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Results - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/descriptions/{batchId}/results", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index d1f94499..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fd/batches/v1/descriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index 8d38e6c8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index 46eefd5f..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Status - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/descriptions/{batchId}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs deleted file mode 100644 index a7de48cb..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirements, - operationName: "FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1/classifications", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs deleted file mode 100644 index 8e937113..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Classifications - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirements, - operationName: "FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1/classifications", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index bd7aa3cd..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirements, - operationName: "FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1-deprecated/classifications", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index 958e51ac..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Classifications - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirements, - operationName: "FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1-deprecated/classifications", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 0a7b86d8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirements, - operationName: "FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1-deprecated/descriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 7e1c4772..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Descriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirements, - operationName: "FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1-deprecated/descriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs deleted file mode 100644 index 96c01ce2..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirements, - operationName: "FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1/descriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs deleted file mode 100644 index 85598b4b..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Descriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirements, - operationName: "FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1/descriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs index 615a0b88..0d29e18a 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostRes /// /// Forward Paragon Webhook /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Forward Paragon Webhook + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostRes securityRequirements: s_ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostSecurityRequirements, operationName: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/paragon/webhook", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/connectors/paragon/webhook", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,107 +124,288 @@ partial void ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostRes __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost", + methodName: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync", + pathTemplate: "\"/studio/v1/connectors/paragon/webhook\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost", + methodName: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync", + pathTemplate: "\"/studio/v1/connectors/paragon/webhook\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost", + methodName: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync", + pathTemplate: "\"/studio/v1/connectors/paragon/webhook\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return __content; + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.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), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return __content; + ProcessResponse( + client: HttpClient, + response: __response); + ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost", + methodName: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync", + pathTemplate: "\"/studio/v1/connectors/paragon/webhook\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost", + methodName: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync", + pathTemplate: "\"/studio/v1/connectors/paragon/webhook\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs index fff72f6b..78dad1fa 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdToke /// Generate Org Token /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync( string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsResponseAsync( + entityId: entityId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Org Token + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsResponseAsync( + string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdToke securityRequirements: s_GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostSecurityRequirements, operationName: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/tokens", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/connected-users/{entityId}/tokens", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdToke __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + entityId: entityId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost", + methodName: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/tokens\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost", + methodName: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/tokens\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost", + methodName: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/tokens\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponseContent( + response: __response); + ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost", + methodName: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/tokens\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost", + methodName: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/tokens\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ConnectorsToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ConnectorsToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs index 90bcd74b..51de3d27 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe /// Combine section answers ➜ styled PDF for download /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Combine section answers ➜ styled PDF for download + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsResponseAsync( + + global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe securityRequirements: s_GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostSecurityRequirements, operationName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/rfi/generate-response-pdf", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/generate-response-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponseContent( + response: __response); + ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Combine section answers ➜ styled PDF for download @@ -243,10 +470,12 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe /// /// All section answers concatenated /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( string text, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.MarkdownRequest @@ -256,6 +485,7 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe return await GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs index 48e820d0..254c71f0 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRespon /// Get Assistants By Mcp /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsResponseAsync( + mcpId: mcpId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Assistants By Mcp + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRespon securityRequirements: s_GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetSecurityRequirements, operationName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}/assistants", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}/assistants", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRespon __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponseContent( + response: __response); + ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantsByMcpResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantsByMcpResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantsByMcpResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.AssistantsByMcpResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs index 6f59f946..eb807234 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet /// /// Get Available Models Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Available Models Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet securityRequirements: s_GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetSecurityRequirements, operationName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/settings/models/available", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/settings/models/available", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,107 +124,288 @@ partial void ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return __content; + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.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), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return __content; + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs index 3954d98b..5d2d1335 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,12 +51,40 @@ partial void ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsers /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync( string entityId, string dataSource, string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsResponseAsync( + entityId: entityId, + dataSource: dataSource, + paragonToken: paragonToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Connector Connection Status + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsResponseAsync( + string entityId, + string dataSource, + string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -72,25 +101,47 @@ partial void ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsers securityRequirements: s_GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetSecurityRequirements, operationName: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("paragon_token", paragonToken) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("paragon_token", paragonToken) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -100,152 +151,332 @@ partial void ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsers __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId, - dataSource: dataSource, - paragonToken: paragonToken); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + entityId: entityId!, + dataSource: dataSource!, + paragonToken: paragonToken!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet", + methodName: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet", + methodName: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet", + methodName: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponseContent( + response: __response); + ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorConnectionStatus.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet", + methodName: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet", + methodName: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ConnectorConnectionStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConnectorConnectionStatus.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ConnectorConnectionStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs index 27b7a7b8..d957cf12 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,12 +51,40 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdD /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync( string entityId, string dataSource, string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsResponseAsync( + entityId: entityId, + dataSource: dataSource, + paragonToken: paragonToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Data Source Status + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsResponseAsync( + string entityId, + string dataSource, + string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -72,25 +101,47 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdD securityRequirements: s_GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetSecurityRequirements, operationName: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("paragon_token", paragonToken) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("paragon_token", paragonToken) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -100,152 +151,332 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdD __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId, - dataSource: dataSource, - paragonToken: paragonToken); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + entityId: entityId!, + dataSource: dataSource!, + paragonToken: paragonToken!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet", + methodName: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet", + methodName: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet", + methodName: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponseContent( + response: __response); + ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet", + methodName: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet", + methodName: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ConnectorsStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ConnectorsStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs index bfb8180d..72d7693c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( /// Get a specific demo by ID. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetDemoStudioV1DemosDemoIdGetAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDemoStudioV1DemosDemoIdGetAsResponseAsync( + demoId: demoId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Demo
+ /// Get a specific demo by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetDemoStudioV1DemosDemoIdGetAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( securityRequirements: s_GetDemoStudioV1DemosDemoIdGetSecurityRequirements, operationName: "GetDemoStudioV1DemosDemoIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/{demoId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/{demoId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,150 +134,330 @@ partial void ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetDemoStudioV1DemosDemoIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - demoId: demoId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetDemoStudioV1DemosDemoIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + demoId: demoId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetDemoStudioV1DemosDemoIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( + response: __response); + ProcessGetDemoStudioV1DemosDemoIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs index b33bd6a0..7a6ca36e 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseConten /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync( string fileId, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsResponseAsync( + fileId: fileId, + apiKey: apiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get File Url + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsResponseAsync( + string fileId, + string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,25 +93,47 @@ partial void ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseConten securityRequirements: s_GetFileUrlStudioV1DemosScraperFileUrlFileIdGetSecurityRequirements, operationName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/scraper/file-url/{fileId}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("api_key", apiKey) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/scraper/file-url/{fileId}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("api_key", apiKey) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,147 +143,327 @@ partial void ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseConten __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetFileUrlStudioV1DemosScraperFileUrlFileIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId, - apiKey: apiKey); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetFileUrlStudioV1DemosScraperFileUrlFileIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + apiKey: apiKey); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{fileId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{fileId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{fileId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseContent( + response: __response); + ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{fileId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{fileId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs index b12b2046..2d25a5ed 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( /// Get Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetMcpStorageStudioV1McpStorageMcpIdGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetMcpStorageStudioV1McpStorageMcpIdGetAsResponseAsync( + mcpId: mcpId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetMcpStorageStudioV1McpStorageMcpIdGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( securityRequirements: s_GetMcpStorageStudioV1McpStorageMcpIdGetSecurityRequirements, operationName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetMcpStorageStudioV1McpStorageMcpIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetMcpStorageStudioV1McpStorageMcpIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( + response: __response); + ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs index 46b2c91c..78baa501 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityI /// Get Org Data Sources Info /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync( string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsResponseAsync( + entityId: entityId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Org Data Sources Info + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsResponseAsync( + string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityI securityRequirements: s_GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetSecurityRequirements, operationName: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityI __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + entityId: entityId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet", + methodName: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet", + methodName: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet", + methodName: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponseContent( + response: __response); + ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorsDataSources.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet", + methodName: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet", + methodName: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ConnectorsDataSources.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConnectorsDataSources.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ConnectorsDataSources.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs index db3a80ba..4a6b3ddc 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrga /// Get Organization Schemas /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync( string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsResponseAsync( + organizationId: organizationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Organization Schemas + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsResponseAsync( + string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrga securityRequirements: s_GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetSecurityRequirements, operationName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrga __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponseContent( + response: __response); + ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.OrgSchemas.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.OrgSchemas.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.OrgSchemas.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.OrgSchemas.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs index 9ef705e0..2531bd0e 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -51,11 +52,40 @@ partial void ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanation /// /// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync( string executionId, bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsResponseAsync( + executionId: executionId, + forceRegenerate: forceRegenerate, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Output Explanation
+ /// Get output explanation for an execution (cached or generated).
+ /// Set force_regenerate=True to regenerate even if cached. + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsResponseAsync( + string executionId, + bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -71,25 +101,47 @@ partial void ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanation securityRequirements: s_GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetSecurityRequirements, operationName: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/executions/{executionId}/explanations/output", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("force_regenerate", forceRegenerate?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/executions/{executionId}/explanations/output", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("force_regenerate", forceRegenerate?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -99,147 +151,327 @@ partial void ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanation __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - executionId: executionId, - forceRegenerate: forceRegenerate); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + executionId: executionId!, + forceRegenerate: forceRegenerate); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet", + methodName: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/output\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet", + methodName: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/output\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet", + methodName: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/output\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponseContent( + response: __response); + ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet", + methodName: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/output\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet", + methodName: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/output\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs index b48ae78b..da0fa4df 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRe /// Get the parsed file from the document modifier. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync( string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsResponseAsync( + fileName: fileName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Parsed File
+ /// Get the parsed file from the document modifier. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsResponseAsync( + string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,25 +87,47 @@ partial void ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRe securityRequirements: s_GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetSecurityRequirements, operationName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/get-parsed-file", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("file_name", fileName) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/get-parsed-file", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("file_name", fileName) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,146 +137,326 @@ partial void ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRe __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileName: fileName); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileName: fileName!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponseContent( + response: __response); + ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs index e3b68873..797dfba7 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -51,11 +52,40 @@ partial void ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanations /// /// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync( string executionId, bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsResponseAsync( + executionId: executionId, + forceRegenerate: forceRegenerate, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Step Explanations
+ /// Get step explanations for an execution (cached or generated).
+ /// Set force_regenerate=True to regenerate even if cached. + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsResponseAsync( + string executionId, + bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -71,25 +101,47 @@ partial void ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanations securityRequirements: s_GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetSecurityRequirements, operationName: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/executions/{executionId}/explanations/steps", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("force_regenerate", forceRegenerate?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/executions/{executionId}/explanations/steps", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("force_regenerate", forceRegenerate?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -99,147 +151,327 @@ partial void ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanations __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - executionId: executionId, - forceRegenerate: forceRegenerate); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + executionId: executionId!, + forceRegenerate: forceRegenerate); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet", + methodName: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/steps\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet", + methodName: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/steps\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet", + methodName: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/steps\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponseContent( + response: __response); + ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet", + methodName: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/steps\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet", + methodName: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync", + pathTemplate: "$\"/studio/v1/executions/{executionId}/explanations/steps\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs index c76a4686..a52b4b92 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStore /// Get a vector store by ID. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync( string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsResponseAsync( + vectorStoreId: vectorStoreId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Vector Store
+ /// Get a vector store by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsResponseAsync( + string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStore securityRequirements: s_GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetSecurityRequirements, operationName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/regulations/vector-store/{vectorStoreId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/regulations/vector-store/{vectorStoreId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,146 +134,326 @@ partial void ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStore __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - vectorStoreId: vectorStoreId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + vectorStoreId: vectorStoreId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponseContent( + response: __response); + ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs index 9c550c13..25a5b357 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdG /// Get Website Connector By Id /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync( string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsResponseAsync( + connectorId: connectorId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Website Connector By Id + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsResponseAsync( + string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdG securityRequirements: s_GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetSecurityRequirements, operationName: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/website/{connectorId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/website/{connectorId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,146 +132,326 @@ partial void ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdG __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - connectorId: connectorId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + connectorId: connectorId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet", + methodName: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet", + methodName: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet", + methodName: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponseContent( + response: __response); + ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet", + methodName: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet", + methodName: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs index ab1e01bf..3b7aa09f 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponseConte /// /// Get Website Connector /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Website Connector + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponseConte securityRequirements: s_GetWebsiteConnectorStudioV1ConnectorsWebsiteGetSecurityRequirements, operationName: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/website", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/connectors/website", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,107 +124,288 @@ partial void ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponseConte __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetWebsiteConnectorStudioV1ConnectorsWebsiteGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWebsiteConnectorStudioV1ConnectorsWebsiteGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGet", + methodName: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGet", + methodName: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGet", + methodName: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return __content; + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.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), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return __content; + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGet", + methodName: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + 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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGet", + methodName: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs index baef1842..883e836c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSec /// Get Workspace Model Secret Endpoint /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync( string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsResponseAsync( + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workspace Model Secret Endpoint + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsResponseAsync( + string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSec securityRequirements: s_GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetSecurityRequirements, operationName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/settings/models/{name}/secrets", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/settings/models/{name}/secrets", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSec __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponseContent( + response: __response); + ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.SecretResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.SecretResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.SecretResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.SecretResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs index bcb25460..bfecd5c6 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsMode /// /// Get Workspace Models By Organization Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workspace Models By Organization Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsMode securityRequirements: s_GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetSecurityRequirements, operationName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/settings/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/settings/models", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,111 +124,292 @@ partial void ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsMode __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/models\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/models\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/models\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return - global::AI21.WorkspaceModelsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.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), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return - await global::AI21.WorkspaceModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/models\"", + 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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/models\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.WorkspaceModelsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.WorkspaceModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs index dc0f6aa6..b4a261da 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes /// Execute a Jamba request. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Jamba Execute
+ /// Execute a Jamba request. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsResponseAsync( + + global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes securityRequirements: s_JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostSecurityRequirements, operationName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/jamba-execute", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/jamba-execute", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,152 +139,332 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponseContent( + response: __response); + ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Jamba Execute
@@ -246,6 +474,7 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( @@ -253,6 +482,7 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes string task, string prompt, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.JambaExecuteRequest @@ -265,6 +495,7 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes return await JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index 458183fd..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirement0, - }; - partial void PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Document Upload Process Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirements, - operationName: "KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh-document-upload/process", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index eada2ef4..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirement0, - }; - partial void PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Document Upload Process - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirements, - operationName: "KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh-document-upload/process", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs deleted file mode 100644 index 30cb9da8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirement0, - }; - partial void PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Email Assistant Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirements, - operationName: "KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/email-assistant", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs deleted file mode 100644 index 78033089..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirement0, - }; - partial void PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Email Assistant - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirements, - operationName: "KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/email-assistant", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index 7b750fa3..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Funding And Categorization Check Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirements, - operationName: "KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/funding-and-categorization-check", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index 5b9e0060..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Funding And Categorization Check - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirements, - operationName: "KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/funding-and-categorization-check", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs deleted file mode 100644 index f2df7857..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirement0, - }; - partial void PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Compliance Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirements, - operationName: "KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/grant-compliance", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs deleted file mode 100644 index 3935fd8f..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirement0, - }; - partial void PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Compliance - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirements, - operationName: "KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/grant-compliance", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs deleted file mode 100644 index 4b9df551..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirement0, - }; - partial void PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Metadata Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirements, - operationName: "KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/grant-metadata", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs deleted file mode 100644 index cbd08e5c..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirement0, - }; - partial void PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Metadata - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirements, - operationName: "KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/grant-metadata", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs new file mode 100644 index 00000000..a9ea2e4c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetSecurityRequirement0, + }; + partial void PrepareKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string jobId); + partial void PrepareKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string jobId); + partial void ProcessKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Public Information Check Job Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Public Information Check Job Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetArguments( + httpClient: HttpClient, + jobId: ref jobId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetSecurityRequirements, + operationName: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/kirsh/public-information-check/jobs/{jobId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + jobId: jobId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions-preview/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions-preview/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions-preview/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions-preview/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions-preview/kirsh/public-information-check/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessKirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs new file mode 100644 index 00000000..3f8dc3b2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetSecurityRequirement0, + }; + partial void PrepareKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string jobId); + partial void PrepareKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string jobId); + partial void ProcessKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Public Information Check Job + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Public Information Check Job + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetArguments( + httpClient: HttpClient, + jobId: ref jobId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetSecurityRequirements, + operationName: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/kirsh/public-information-check/jobs/{jobId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + jobId: jobId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions/kirsh/public-information-check/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet", + methodName: "KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync", + pathTemplate: "$\"/solutions/kirsh/public-information-check/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessKirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs new file mode 100644 index 00000000..30025891 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostSecurityRequirement0, + }; + partial void PrepareKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Public Information Check Jobs Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Public Information Check Jobs Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostSecurityRequirements, + operationName: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/kirsh/public-information-check/jobs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessKirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs new file mode 100644 index 00000000..83e29de1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostSecurityRequirement0, + }; + partial void PrepareKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Public Information Check Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Public Information Check Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostSecurityRequirements, + operationName: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/kirsh/public-information-check/jobs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost", + methodName: "KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessKirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 05968fc3..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Public Information Check Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirements, - operationName: "KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/public-information-check", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 9bc7a736..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Public Information Check - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirements, - operationName: "KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/public-information-check", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs index 002ca4a3..47cf6939 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -42,9 +43,29 @@ partial void ProcessListDemosStudioV1DemosGetResponseContent( /// List Demos
/// List all available demos. ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ListDemosStudioV1DemosGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDemosStudioV1DemosGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Demos
+ /// List all available demos. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListDemosStudioV1DemosGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -58,22 +79,44 @@ partial void ProcessListDemosStudioV1DemosGetResponseContent( securityRequirements: s_ListDemosStudioV1DemosGetSecurityRequirements, operationName: "ListDemosStudioV1DemosGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -83,111 +126,292 @@ partial void ProcessListDemosStudioV1DemosGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListDemosStudioV1DemosGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListDemosStudioV1DemosGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListDemosStudioV1DemosGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListDemosStudioV1DemosGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.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), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListDemosStudioV1DemosGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListDemosStudioV1DemosGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs index b62dac54..6f0f129d 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessListMcpStorageStudioV1McpStorageGetResponseContent( /// List Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task ListMcpStorageStudioV1McpStorageGetAsync( global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMcpStorageStudioV1McpStorageGetAsResponseAsync( + workspaceId: workspaceId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListMcpStorageStudioV1McpStorageGetAsResponseAsync( + global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessListMcpStorageStudioV1McpStorageGetResponseContent( securityRequirements: s_ListMcpStorageStudioV1McpStorageGetSecurityRequirements, operationName: "ListMcpStorageStudioV1McpStorageGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/mcp/storage", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("workspace_id", workspaceId?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/mcp/storage", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("workspace_id", workspaceId?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,150 +135,330 @@ partial void ProcessListMcpStorageStudioV1McpStorageGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListMcpStorageStudioV1McpStorageGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - workspaceId: workspaceId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListMcpStorageStudioV1McpStorageGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + workspaceId: workspaceId); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListMcpStorageStudioV1McpStorageGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessListMcpStorageStudioV1McpStorageGetResponseContent( + response: __response); + ProcessListMcpStorageStudioV1McpStorageGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListMCPsStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListMCPsStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListMcpStorageStudioV1McpStorageGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListMCPsStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ListMCPsStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs index 7db18bf4..6bf262a1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( /// Mcp Tool Discovery /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( global::AI21.MCPDefinition request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpToolDiscoveryStudioV1McpDiscoverPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Mcp Tool Discovery + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> McpToolDiscoveryStudioV1McpDiscoverPostAsResponseAsync( + + global::AI21.MCPDefinition request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( securityRequirements: s_McpToolDiscoveryStudioV1McpDiscoverPostSecurityRequirements, operationName: "McpToolDiscoveryStudioV1McpDiscoverPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/mcp/discover", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/mcp/discover", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,156 +137,336 @@ partial void ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareMcpToolDiscoveryStudioV1McpDiscoverPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareMcpToolDiscoveryStudioV1McpDiscoverPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "McpToolDiscoveryStudioV1McpDiscoverPost", + methodName: "McpToolDiscoveryStudioV1McpDiscoverPostAsync", + pathTemplate: "\"/studio/v1/mcp/discover\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "McpToolDiscoveryStudioV1McpDiscoverPost", + methodName: "McpToolDiscoveryStudioV1McpDiscoverPostAsync", + pathTemplate: "\"/studio/v1/mcp/discover\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "McpToolDiscoveryStudioV1McpDiscoverPost", + methodName: "McpToolDiscoveryStudioV1McpDiscoverPostAsync", + pathTemplate: "\"/studio/v1/mcp/discover\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( + response: __response); + ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPDiscoveryResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "McpToolDiscoveryStudioV1McpDiscoverPost", + methodName: "McpToolDiscoveryStudioV1McpDiscoverPostAsync", + pathTemplate: "\"/studio/v1/mcp/discover\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "McpToolDiscoveryStudioV1McpDiscoverPost", + methodName: "McpToolDiscoveryStudioV1McpDiscoverPostAsync", + pathTemplate: "\"/studio/v1/mcp/discover\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MCPDiscoveryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MCPDiscoveryResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.MCPDiscoveryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Mcp Tool Discovery @@ -247,12 +474,14 @@ partial void ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( string serverUrl, string? serverLabel = default, object? headers = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.MCPDefinition @@ -264,6 +493,7 @@ partial void ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( return await McpToolDiscoveryStudioV1McpDiscoverPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs index fb2c133e..dcc37960 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon /// Parse a PDF file and return its contents. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + + global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon securityRequirements: s_ParsePdfStudioV1DemosDocumentModifierParsePdfPostSecurityRequirements, operationName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/parse-pdf", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/parse-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,180 +139,1279 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; + } } - __httpRequest.Content = __httpRequestContent; - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + __httpRequest.Content = __httpRequestContent; - ProcessResponse( - client: HttpClient, - response: __response); - ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + response: __response); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + byte[] file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost + { + File = file, + Filename = filename, + }; + + return await ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + global::System.IO.Stream file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ParsePdfStudioV1DemosDocumentModifierParsePdfPostSecurityRequirements, + operationName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/parse-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - ).ConfigureAwait(false); - return __content; + 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); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - string? __content = null; + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Parse Pdf
/// Parse a PDF file and return its contents. ///
- /// + /// + /// The stream to send as the multipart 'file' file part. + /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + global::System.IO.Stream file, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost { - File = file, + File = global::System.Array.Empty(), Filename = filename, }; + PrepareArguments( + client: HttpClient); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostArguments( + httpClient: HttpClient, + request: request); - return await ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ParsePdfStudioV1DemosDocumentModifierParsePdfPostSecurityRequirements, + operationName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/parse-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs index 7fce17e0..217266dc 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseCon /// Post Website Connector /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( global::AI21.WebsiteConnectorPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Post Website Connector + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsResponseAsync( + + global::AI21.WebsiteConnectorPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseCon securityRequirements: s_PostWebsiteConnectorStudioV1ConnectorsWebsitePostSecurityRequirements, operationName: "PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/website", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/connectors/website", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,163 +137,345 @@ partial void ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseCon __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostWebsiteConnectorStudioV1ConnectorsWebsitePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PreparePostWebsiteConnectorStudioV1ConnectorsWebsitePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostWebsiteConnectorStudioV1ConnectorsWebsitePost", + methodName: "PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostWebsiteConnectorStudioV1ConnectorsWebsitePost", + methodName: "PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostWebsiteConnectorStudioV1ConnectorsWebsitePost", + methodName: "PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseContent( + response: __response); + ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostWebsiteConnectorStudioV1ConnectorsWebsitePost", + methodName: "PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PostWebsiteConnectorStudioV1ConnectorsWebsitePost", + methodName: "PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync", + pathTemplate: "\"/studio/v1/connectors/website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Post Website Connector /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( global::AI21.WebsiteConnectorPayloadType type, global::AI21.AnyOf> value, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorPayload @@ -257,6 +486,7 @@ partial void ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseCon return await PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs index e3174905..0b2d6f2d 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont /// Process Rfi Document /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Process Rfi Document + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + + global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont securityRequirements: s_ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostSecurityRequirements, operationName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/rfi/process-rfi", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/process-rfi", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,174 +137,900 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; + } } - if (request.Budget != default) - { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Budget}"), - name: "\"budget\""); - } - if (request.VectorStoreId != default) - { + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.VectorStoreId}"), - name: "\"vector_store_id\""); - } - __httpRequest.Content = __httpRequestContent; + if (request.Budget != default) + { - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + } + if (request.VectorStoreId != default) + { - ProcessResponse( - client: HttpClient, - response: __response); - ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + response: __response); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + byte[] file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost + { + File = file, + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + + return await ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost + { + File = global::System.Array.Empty(), + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + PrepareArguments( + client: HttpClient); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostSecurityRequirements, + operationName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/process-rfi", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + 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); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - string? __content = null; + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); } } /// @@ -276,26 +1049,468 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + global::System.IO.Stream file, string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost { - File = file, + File = global::System.Array.Empty(), Filename = filename, Budget = budget, VectorStoreId = vectorStoreId, }; + PrepareArguments( + client: HttpClient); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostArguments( + httpClient: HttpClient, + request: request); - return await ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostSecurityRequirements, + operationName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/process-rfi", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs index adc0c1aa..b56c3931 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostR /// Run Sync /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( global::AI21.ConnectorsSyncParams request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Sync + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsResponseAsync( + + global::AI21.ConnectorsSyncParams request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostR securityRequirements: s_RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostSecurityRequirements, operationName: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/connected-users/data-sources/syncs", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/connectors/connected-users/data-sources/syncs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostR __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost", + methodName: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync", + pathTemplate: "\"/studio/v1/connectors/connected-users/data-sources/syncs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost", + methodName: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync", + pathTemplate: "\"/studio/v1/connectors/connected-users/data-sources/syncs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost", + methodName: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync", + pathTemplate: "\"/studio/v1/connectors/connected-users/data-sources/syncs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponseContent( + response: __response); + ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost", + methodName: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync", + pathTemplate: "\"/studio/v1/connectors/connected-users/data-sources/syncs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost", + methodName: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync", + pathTemplate: "\"/studio/v1/connectors/connected-users/data-sources/syncs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Run Sync @@ -246,6 +473,7 @@ partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostR /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( @@ -255,6 +483,7 @@ partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostR string pipeline, object? configuration = default, string? configurationName = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.ConnectorsSyncParams @@ -269,6 +498,7 @@ partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostR return await RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs index 5605f248..b6fa14d3 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,12 +51,40 @@ partial void ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourc /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync( string entityId, string dataSource, string workflowName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsResponseAsync( + entityId: entityId, + dataSource: dataSource, + workflowName: workflowName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Workflow + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsResponseAsync( + string entityId, + string dataSource, + string workflowName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -72,22 +101,44 @@ partial void ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourc securityRequirements: s_RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostSecurityRequirements, operationName: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -97,148 +148,328 @@ partial void ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourc __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId, - dataSource: dataSource, - workflowName: workflowName); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + entityId: entityId!, + dataSource: dataSource!, + workflowName: workflowName!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost", + methodName: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost", + methodName: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost", + methodName: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponseContent( + response: __response); + ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost", + methodName: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost", + methodName: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync", + pathTemplate: "$\"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs index 68a86cf5..f3f62dd7 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostRespo /// Sync Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync( string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsResponseAsync( + connectorId: connectorId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Sync Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsResponseAsync( + string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostRespo securityRequirements: s_SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostSecurityRequirements, operationName: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/website/{connectorId}/sync", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/connectors/website/{connectorId}/sync", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,146 +132,326 @@ partial void ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostRespo __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - connectorId: connectorId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + connectorId: connectorId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost", + methodName: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}/sync\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost", + methodName: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}/sync\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost", + methodName: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}/sync\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponseContent( + response: __response); + ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost", + methodName: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}/sync\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost", + methodName: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync", + pathTemplate: "$\"/studio/v1/connectors/website/{connectorId}/sync\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index a1c07989..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirement0, - }; - partial void PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Tlv Convrag Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirements, - operationName: "TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/tlv_municipality/convrag", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index d635f04c..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirement0, - }; - partial void PrepareTlvConvragSolutionsTlvMunicipalityConvragPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareTlvConvragSolutionsTlvMunicipalityConvragPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Tlv Convrag - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TlvConvragSolutionsTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareTlvConvragSolutionsTlvMunicipalityConvragPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirements, - operationName: "TlvConvragSolutionsTlvMunicipalityConvragPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/tlv_municipality/convrag", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTlvConvragSolutionsTlvMunicipalityConvragPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs index c334b08a..8aab4254 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -48,12 +49,40 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( string demoId, global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateDemoStudioV1DemosDemoIdPutAsResponseAsync( + demoId: demoId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Demo
+ /// Update an existing demo. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateDemoStudioV1DemosDemoIdPutAsResponseAsync( + string demoId, + + global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -71,22 +100,44 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( securityRequirements: s_UpdateDemoStudioV1DemosDemoIdPutSecurityRequirements, operationName: "UpdateDemoStudioV1DemosDemoIdPutAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/{demoId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Put, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/{demoId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Put, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -96,157 +147,337 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateDemoStudioV1DemosDemoIdPutRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - demoId: demoId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateDemoStudioV1DemosDemoIdPutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + demoId: demoId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateDemoStudioV1DemosDemoIdPutResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "PUT", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "PUT", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "PUT", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( + response: __response); + ProcessUpdateDemoStudioV1DemosDemoIdPutResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "PUT", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "PUT", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Demo
@@ -268,6 +499,7 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( @@ -277,6 +509,7 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( global::AI21.DemoStatus? status = default, object? config = default, string? uiComponentName = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DemoUpdate @@ -291,6 +524,7 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( return await UpdateDemoStudioV1DemosDemoIdPutAsync( demoId: demoId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs index 9f183ee4..c5e0e1c2 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsResponseAsync( + mcpId: mcpId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Mcp Storage + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsResponseAsync( + string mcpId, + + global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( securityRequirements: s_UpdateMcpStorageStudioV1McpStorageMcpIdPatchSecurityRequirements, operationName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,168 +145,350 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateMcpStorageStudioV1McpStorageMcpIdPatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateMcpStorageStudioV1McpStorageMcpIdPatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "PATCH", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "PATCH", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "PATCH", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( + response: __response); + ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "PATCH", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "PATCH", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Mcp Storage /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, string serverLabel, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.UpdateMCPStorageRequest @@ -267,6 +499,7 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( return await UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( mcpId: mcpId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs index d882e995..5ea13c15 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( string name, global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsResponseAsync( + name: name, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Workspace Model Endpoint + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsResponseAsync( + string name, + + global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR securityRequirements: s_UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchSecurityRequirements, operationName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/settings/models/{name}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/settings/models/{name}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "PATCH", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "PATCH", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "PATCH", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponseContent( + response: __response); + ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.WorkspaceModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "PATCH", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + httpMethod: "PATCH", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.WorkspaceModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.WorkspaceModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.WorkspaceModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Workspace Model Endpoint @@ -254,6 +484,7 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( @@ -261,6 +492,7 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR string? requestName = default, string? modelType = default, string? secretId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WorkspaceModelUpdate @@ -273,6 +505,7 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR return await UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( name: name, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs index 2d85a1f1..ae11792c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp /// Check compliance of a document file against regulatory requirements. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + + global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp securityRequirements: s_UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostSecurityRequirements, operationName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/regulations/upload-check-compliance", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/regulations/upload-check-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,177 +139,895 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; + } } - if (request.Budget != default) - { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Budget}"), - name: "\"budget\""); - } - if (request.VectorStoreId != default) - { + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.VectorStoreId}"), - name: "\"vector_store_id\""); - } - __httpRequest.Content = __httpRequestContent; + if (request.Budget != default) + { - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + } + if (request.VectorStoreId != default) + { - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + response: __response); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + byte[] file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost + { + File = file, + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + + return await UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost + { + File = global::System.Array.Empty(), + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostSecurityRequirements, + operationName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/regulations/upload-check-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - ).ConfigureAwait(false); - return __content; + 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); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - string? __content = null; + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Upload Check Compliance
/// Check compliance of a document file against regulatory requirements. ///
- /// + /// + /// The stream to send as the multipart 'file' file part. + /// /// /// /// Default Value: MEDIUM @@ -269,26 +1035,464 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + global::System.IO.Stream file, string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost { - File = file, + File = global::System.Array.Empty(), Filename = filename, Budget = budget, VectorStoreId = vectorStoreId, }; + PrepareArguments( + client: HttpClient); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostArguments( + httpClient: HttpClient, + request: request); - return await UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostSecurityRequirements, + operationName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/regulations/upload-check-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs index 414c44b1..92076d56 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1CreateAssistantResponseContent( /// Create Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateAssistantAsync( global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1CreateAssistantAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1CreateAssistantAsResponseAsync( + + global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1CreateAssistantResponseContent( securityRequirements: s_V1CreateAssistantSecurityRequirements, operationName: "V1CreateAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/assistants", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/assistants", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,156 +137,336 @@ partial void ProcessV1CreateAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1CreateAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1CreateAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1CreateAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1CreateAssistantResponseContent( + response: __response); + ProcessV1CreateAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1CreateAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Assistant @@ -261,6 +488,7 @@ partial void ProcessV1CreateAssistantResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateAssistantAsync( @@ -277,6 +505,7 @@ partial void ProcessV1CreateAssistantResponseContent( string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateAssistantRequest @@ -298,6 +527,7 @@ partial void ProcessV1CreateAssistantResponseContent( return await V1CreateAssistantAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs index be4dd5be..4f6d3485 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1CreatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1CreatePlanAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1CreatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1CreatePlanResponseContent( securityRequirements: s_V1CreatePlanSecurityRequirements, operationName: "V1CreatePlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1CreatePlanResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1CreatePlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1CreatePlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1CreatePlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1CreatePlanResponseContent( + response: __response); + ProcessV1CreatePlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1CreatePlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Plan @@ -253,12 +483,14 @@ partial void ProcessV1CreatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreatePlanPayload @@ -270,6 +502,7 @@ partial void ProcessV1CreatePlanResponseContent( return await V1CreatePlanAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs index a9cce046..4ce9ddd1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1CreateRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateRouteAsync( string assistantId, global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1CreateRouteAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1CreateRouteAsResponseAsync( + string assistantId, + + global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1CreateRouteResponseContent( securityRequirements: s_V1CreateRouteSecurityRequirements, operationName: "V1CreateRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1CreateRouteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1CreateRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1CreateRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1CreateRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1CreateRouteResponseContent( + response: __response); + ProcessV1CreateRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1CreateRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Route @@ -255,6 +485,7 @@ partial void ProcessV1CreateRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateRouteAsync( @@ -263,6 +494,7 @@ partial void ProcessV1CreateRouteResponseContent( string name, string description, global::System.Collections.Generic.IList examples, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateRoutePayload @@ -276,6 +508,7 @@ partial void ProcessV1CreateRouteResponseContent( return await V1CreateRouteAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs index 7da4a25c..92fb1022 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1DeleteAssistantResponseContent( /// Delete Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1DeleteAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1DeleteAssistantAsResponseAsync( + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1DeleteAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1DeleteAssistantResponseContent( securityRequirements: s_V1DeleteAssistantSecurityRequirements, operationName: "V1DeleteAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1DeleteAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1DeleteAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1DeleteAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1DeleteAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "DELETE", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1DeleteAssistantResponseContent( + response: __response); + ProcessV1DeleteAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.DeleteAssistantResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.DeleteAssistantResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1DeleteAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.DeleteAssistantResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.DeleteAssistantResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs index bbcc1a52..8265e308 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1DeleteRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1DeleteRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1DeleteRouteAsResponseAsync( + routeId: routeId, + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1DeleteRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessV1DeleteRouteResponseContent( securityRequirements: s_V1DeleteRouteSecurityRequirements, operationName: "V1DeleteRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,147 +140,327 @@ partial void ProcessV1DeleteRouteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1DeleteRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - routeId: routeId, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1DeleteRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + routeId: routeId!, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1DeleteRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1DeleteRouteResponseContent( + response: __response); + ProcessV1DeleteRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1DeleteRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs index 1c481435..c0003c7b 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1GenerateAssistantResponseContent( /// Generate Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GenerateAssistantAsync( global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GenerateAssistantAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GenerateAssistantAsResponseAsync( + + global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1GenerateAssistantResponseContent( securityRequirements: s_V1GenerateAssistantSecurityRequirements, operationName: "V1GenerateAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/assistants/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/assistants/generate", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,167 +137,349 @@ partial void ProcessV1GenerateAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GenerateAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GenerateAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GenerateAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GenerateAssistantResponseContent( + response: __response); + ProcessV1GenerateAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.GenerateAssistantResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.GenerateAssistantResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GenerateAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.GenerateAssistantResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.GenerateAssistantResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Generate Assistant /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GenerateAssistantAsync( string prompt, string? avatar = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.GenerateAssistantRequest @@ -261,6 +490,7 @@ partial void ProcessV1GenerateAssistantResponseContent( return await V1GenerateAssistantAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs index 0242b6d8..a83a175e 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1GetAssistantResponseContent( /// Get Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetAssistantAsResponseAsync( + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1GetAssistantResponseContent( securityRequirements: s_V1GetAssistantSecurityRequirements, operationName: "V1GetAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1GetAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetAssistantResponseContent( + response: __response); + ProcessV1GetAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs index 209273ee..4dd54e93 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1GetMaestroRunResponseContent( /// Get Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetMaestroRunAsync( string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetMaestroRunAsResponseAsync( + executionId: executionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetMaestroRunAsResponseAsync( + string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1GetMaestroRunResponseContent( securityRequirements: s_V1GetMaestroRunSecurityRequirements, operationName: "V1GetMaestroRunAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/maestro/runs/{executionId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/maestro/runs/{executionId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1GetMaestroRunResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetMaestroRunRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - executionId: executionId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetMaestroRunRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + executionId: executionId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetMaestroRunResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetMaestroRunResponseContent( + response: __response); + ProcessV1GetMaestroRunResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetMaestroRunResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs index 9e03fbb6..c69669f0 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1GetPlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetPlanAsync( string planId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetPlanAsResponseAsync( + planId: planId, + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetPlanAsResponseAsync( + string planId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessV1GetPlanResponseContent( securityRequirements: s_V1GetPlanSecurityRequirements, operationName: "V1GetPlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,151 +140,331 @@ partial void ProcessV1GetPlanResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetPlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - planId: planId, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetPlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + planId: planId!, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetPlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetPlanResponseContent( + response: __response); + ProcessV1GetPlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetPlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs index 281f7fa6..70f2edeb 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1GetRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetRouteAsResponseAsync( + routeId: routeId, + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessV1GetRouteResponseContent( securityRequirements: s_V1GetRouteSecurityRequirements, operationName: "V1GetRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,151 +140,331 @@ partial void ProcessV1GetRouteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - routeId: routeId, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + routeId: routeId!, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetRouteResponseContent( + response: __response); + ProcessV1GetRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs index 2315517f..657e90b1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1ListAssistantsResponseContent( /// Get Assistants /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ListAssistantsAsync( global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListAssistantsAsResponseAsync( + workspaceIds: workspaceIds, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Assistants + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ListAssistantsAsResponseAsync( + global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1ListAssistantsResponseContent( securityRequirements: s_V1ListAssistantsSecurityRequirements, operationName: "V1ListAssistantsAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/assistants", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("workspace_ids", workspaceIds, delimiter: ",", explode: true) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/assistants", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("workspace_ids", workspaceIds, delimiter: ",", explode: true) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,150 +135,330 @@ partial void ProcessV1ListAssistantsResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListAssistantsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - workspaceIds: workspaceIds); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListAssistantsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + workspaceIds: workspaceIds); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListAssistantsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListAssistantsResponseContent( + response: __response); + ProcessV1ListAssistantsResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListAssistantsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListAssistantsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListAssistantsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListAssistantsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ListAssistantsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs index 1857d1a6..0d266b70 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessV1ListModelsInfoResponseContent( /// /// Get Models Info /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ListModelsInfoAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListModelsInfoAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Models Info + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ListModelsInfoAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessV1ListModelsInfoResponseContent( securityRequirements: s_V1ListModelsInfoSecurityRequirements, operationName: "V1ListModelsInfoAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/models", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,111 +124,292 @@ partial void ProcessV1ListModelsInfoResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListModelsInfoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListModelsInfoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListModelsInfoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/v1/models\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/v1/models\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListModelsInfoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/v1/models\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return - global::AI21.ModelsInfoResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.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), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return - await global::AI21.ModelsInfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1ListModelsInfoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/v1/models\"", + 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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/v1/models\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListModelsInfoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ModelsInfoResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ModelsInfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs index 320437c3..6fcdce06 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1ListPlansResponseContent( /// List Plans /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ListPlansAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListPlansAsResponseAsync( + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Plans + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ListPlansAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1ListPlansResponseContent( securityRequirements: s_V1ListPlansSecurityRequirements, operationName: "V1ListPlansAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1ListPlansResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListPlansRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListPlansRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListPlansResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListPlansResponseContent( + response: __response); + ProcessV1ListPlansResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListPlansResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListPlansResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListPlansResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListPlansResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ListPlansResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs index 0ac233b6..60fd072f 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1ListRoutesResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ListRoutesAsync( string assistantId, string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListRoutesAsResponseAsync( + assistantId: assistantId, + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Routes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ListRoutesAsResponseAsync( + string assistantId, + string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,25 +93,47 @@ partial void ProcessV1ListRoutesResponseContent( securityRequirements: s_V1ListRoutesSecurityRequirements, operationName: "V1ListRoutesAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("name", name) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("name", name) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,151 +143,331 @@ partial void ProcessV1ListRoutesResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListRoutesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - name: name); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListRoutesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + name: name); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListRoutesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListRoutesResponseContent( + response: __response); + ProcessV1ListRoutesResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListRoutesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListRoutesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListRoutesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListRoutesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ListRoutesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs index 775312ef..6131c1ae 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1MaestroRunResponseContent( /// Create Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1MaestroRunAsync( global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1MaestroRunAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1MaestroRunAsResponseAsync( + + global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1MaestroRunResponseContent( securityRequirements: s_V1MaestroRunSecurityRequirements, operationName: "V1MaestroRunAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/maestro/runs", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/maestro/runs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,156 +137,336 @@ partial void ProcessV1MaestroRunResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1MaestroRunRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1MaestroRunRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1MaestroRunResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1MaestroRunResponseContent( + response: __response); + ProcessV1MaestroRunResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1MaestroRunResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Maestro Run @@ -278,6 +505,7 @@ partial void ProcessV1MaestroRunResponseContent( /// be 1. A streaming response is different than the non-streaming response.
/// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1MaestroRunAsync( @@ -298,6 +526,7 @@ partial void ProcessV1MaestroRunResponseContent( global::AI21.CreateMaestroRunsPayloadResponseLanguage? responseLanguage = default, string? systemPrompt = default, bool? stream = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateMaestroRunsPayload @@ -323,6 +552,7 @@ partial void ProcessV1MaestroRunResponseContent( return await V1MaestroRunAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs index 328101e0..1c6cf137 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1ModifyAssistantResponseContent( ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyAssistantAsync( string assistantId, global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ModifyAssistantAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ModifyAssistantAsResponseAsync( + string assistantId, + + global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1ModifyAssistantResponseContent( securityRequirements: s_V1ModifyAssistantSecurityRequirements, operationName: "V1ModifyAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1ModifyAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ModifyAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ModifyAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ModifyAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "PATCH", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "PATCH", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "PATCH", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ModifyAssistantResponseContent( + response: __response); + ProcessV1ModifyAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "PATCH", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "PATCH", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ModifyAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Modify Assistant @@ -273,6 +503,7 @@ partial void ProcessV1ModifyAssistantResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyAssistantAsync( @@ -291,6 +522,7 @@ partial void ProcessV1ModifyAssistantResponseContent( string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.ModifyAssistantRequest @@ -314,6 +546,7 @@ partial void ProcessV1ModifyAssistantResponseContent( return await V1ModifyAssistantAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs index b1aaa55d..539c658d 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,6 +51,7 @@ partial void ProcessV1ModifyPlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -57,6 +59,35 @@ partial void ProcessV1ModifyPlanResponseContent( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ModifyPlanAsResponseAsync( + planId: planId, + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Plan + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ModifyPlanAsResponseAsync( + string planId, + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -75,22 +106,44 @@ partial void ProcessV1ModifyPlanResponseContent( securityRequirements: s_V1ModifyPlanSecurityRequirements, operationName: "V1ModifyPlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -100,158 +153,338 @@ partial void ProcessV1ModifyPlanResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ModifyPlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - planId: planId, - assistantId: assistantId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ModifyPlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + planId: planId!, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ModifyPlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + httpMethod: "PATCH", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + httpMethod: "PATCH", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + httpMethod: "PATCH", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ModifyPlanResponseContent( + response: __response); + ProcessV1ModifyPlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + httpMethod: "PATCH", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + httpMethod: "PATCH", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ModifyPlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Modify Plan @@ -260,6 +493,7 @@ partial void ProcessV1ModifyPlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -267,6 +501,7 @@ partial void ProcessV1ModifyPlanResponseContent( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreatePlanPayload @@ -279,6 +514,7 @@ partial void ProcessV1ModifyPlanResponseContent( planId: planId, assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs index af3b476a..20162ed6 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,6 +51,7 @@ partial void ProcessV1ModifyRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -57,6 +59,35 @@ partial void ProcessV1ModifyRouteResponseContent( string assistantId, global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ModifyRouteAsResponseAsync( + routeId: routeId, + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Route + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ModifyRouteAsResponseAsync( + string routeId, + string assistantId, + + global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -75,22 +106,44 @@ partial void ProcessV1ModifyRouteResponseContent( securityRequirements: s_V1ModifyRouteSecurityRequirements, operationName: "V1ModifyRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -100,158 +153,338 @@ partial void ProcessV1ModifyRouteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ModifyRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - routeId: routeId, - assistantId: assistantId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ModifyRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + routeId: routeId!, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ModifyRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "PATCH", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "PATCH", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "PATCH", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ModifyRouteResponseContent( + response: __response); + ProcessV1ModifyRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "PATCH", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "PATCH", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ModifyRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Modify Route @@ -260,6 +493,7 @@ partial void ProcessV1ModifyRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -267,6 +501,7 @@ partial void ProcessV1ModifyRouteResponseContent( string assistantId, string description, global::System.Collections.Generic.IList? examples = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.UpdateRoutePayload @@ -279,6 +514,7 @@ partial void ProcessV1ModifyRouteResponseContent( routeId: routeId, assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs index 094792fc..407c1f36 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1RunAssistantResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1RunAssistantAsync( string assistantId, global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1RunAssistantAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1RunAssistantAsResponseAsync( + string assistantId, + + global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1RunAssistantResponseContent( securityRequirements: s_V1RunAssistantSecurityRequirements, operationName: "V1RunAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/run", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/run", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1RunAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1RunAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1RunAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1RunAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1RunAssistantResponseContent( + response: __response); + ProcessV1RunAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1RunAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Run Assistant @@ -269,6 +499,7 @@ partial void ProcessV1RunAssistantResponseContent( /// Default Value: unset /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1RunAssistantAsync( @@ -281,6 +512,7 @@ partial void ProcessV1RunAssistantResponseContent( bool? dynamicPlanningEnabled = default, global::AI21.RunAssistantRequestResponseLanguage? responseLanguage = default, string? systemPrompt = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.RunAssistantRequest @@ -298,6 +530,7 @@ partial void ProcessV1RunAssistantResponseContent( return await V1RunAssistantAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotyProductLookup.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotyProductLookup.g.cs new file mode 100644 index 00000000..7267b65c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotyProductLookup.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsClarotyProductLookupSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsClarotyProductLookupSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsClarotyProductLookupSecurityRequirement0, + }; + partial void PrepareV1SolutionsClarotyProductLookupArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsClarotyProductLookupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsClarotyProductLookupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsClarotyProductLookupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Claroty Product Lookup + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsClarotyProductLookupAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsClarotyProductLookupAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Claroty Product Lookup + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsClarotyProductLookupAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsClarotyProductLookupArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsClarotyProductLookupSecurityRequirements, + operationName: "V1SolutionsClarotyProductLookupAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/claroty/product-lookup", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsClarotyProductLookupRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotyProductLookup", + methodName: "V1SolutionsClarotyProductLookupAsync", + pathTemplate: "\"/solutions/claroty/product-lookup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotyProductLookup", + methodName: "V1SolutionsClarotyProductLookupAsync", + pathTemplate: "\"/solutions/claroty/product-lookup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotyProductLookup", + methodName: "V1SolutionsClarotyProductLookupAsync", + pathTemplate: "\"/solutions/claroty/product-lookup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsClarotyProductLookupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotyProductLookup", + methodName: "V1SolutionsClarotyProductLookupAsync", + pathTemplate: "\"/solutions/claroty/product-lookup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotyProductLookup", + methodName: "V1SolutionsClarotyProductLookupAsync", + pathTemplate: "\"/solutions/claroty/product-lookup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsClarotyProductLookupResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotySuggestVendorModel.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotySuggestVendorModel.g.cs new file mode 100644 index 00000000..684d7974 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotySuggestVendorModel.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsClarotySuggestVendorModelSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsClarotySuggestVendorModelSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsClarotySuggestVendorModelSecurityRequirement0, + }; + partial void PrepareV1SolutionsClarotySuggestVendorModelArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsClarotySuggestVendorModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsClarotySuggestVendorModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsClarotySuggestVendorModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Claroty Suggest Vendor Model + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsClarotySuggestVendorModelAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsClarotySuggestVendorModelAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Claroty Suggest Vendor Model + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsClarotySuggestVendorModelAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsClarotySuggestVendorModelArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsClarotySuggestVendorModelSecurityRequirements, + operationName: "V1SolutionsClarotySuggestVendorModelAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/claroty/suggest-vendor-model", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsClarotySuggestVendorModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotySuggestVendorModel", + methodName: "V1SolutionsClarotySuggestVendorModelAsync", + pathTemplate: "\"/solutions/claroty/suggest-vendor-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotySuggestVendorModel", + methodName: "V1SolutionsClarotySuggestVendorModelAsync", + pathTemplate: "\"/solutions/claroty/suggest-vendor-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotySuggestVendorModel", + methodName: "V1SolutionsClarotySuggestVendorModelAsync", + pathTemplate: "\"/solutions/claroty/suggest-vendor-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsClarotySuggestVendorModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotySuggestVendorModel", + methodName: "V1SolutionsClarotySuggestVendorModelAsync", + pathTemplate: "\"/solutions/claroty/suggest-vendor-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsClarotySuggestVendorModel", + methodName: "V1SolutionsClarotySuggestVendorModelAsync", + pathTemplate: "\"/solutions/claroty/suggest-vendor-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsClarotySuggestVendorModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs new file mode 100644 index 00000000..9a4d1a2d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdBatchesV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fd/batches/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1ClassificationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..1b07b038 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1ClassificationsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1ClassificationsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1ClassificationsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1ClassificationsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/classifications/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1ClassificationsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..b06f04e1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1ClassificationsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1ClassificationsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1ClassificationsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1ClassificationsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/classifications/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1ClassificationsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..102fa6ef --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdBatchesV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fd/batches/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1DescriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..224e7ea8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1DescriptionsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1DescriptionsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1DescriptionsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1DescriptionsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/descriptions/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1DescriptionsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..f75c519e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1DescriptionsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1DescriptionsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1DescriptionsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1DescriptionsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/descriptions/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1DescriptionsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs new file mode 100644 index 00000000..605b1531 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fd/batches/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..cd550cd8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..c95ba6d7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..665c9f2f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fd/batches/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..c87697b2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..6ff19d4d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs new file mode 100644 index 00000000..e815617c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesBatchPredictArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacAftersalesBatchPredictRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacAftersalesBatchPredictResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesBatchPredictResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesBatchPredictAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesBatchPredictArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesBatchPredictAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fd_aftersales/parts-classification/batch", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesBatchPredictRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesBatchPredictResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacAftersalesBatchPredictResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs new file mode 100644 index 00000000..457263d1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesBatchPredictStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFnacAftersalesBatchPredictStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesBatchPredictStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesBatchPredictStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesBatchPredictStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs new file mode 100644 index 00000000..0a40a221 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesPreviewBatchPredictAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fd_aftersales/parts-classification/batch", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs new file mode 100644 index 00000000..fb54eaaf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs new file mode 100644 index 00000000..e9a94be7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1ClassificationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacPreviewV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..1b966a1d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1DeprecatedClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1-deprecated/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..90dcee62 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1-deprecated/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs new file mode 100644 index 00000000..1b92ae35 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1DescriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacPreviewV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs new file mode 100644 index 00000000..e1275d81 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1ClassificationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..93172a24 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1DeprecatedClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1DeprecatedClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1DeprecatedClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1DeprecatedClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1DeprecatedClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1DeprecatedClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacV1DeprecatedClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1-deprecated/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1DeprecatedClassificationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1DeprecatedClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacV1DeprecatedClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..5bfbf990 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1DeprecatedDescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1DeprecatedDescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1DeprecatedDescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1DeprecatedDescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1-deprecated/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1DeprecatedDescriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs new file mode 100644 index 00000000..1928d186 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1DescriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshDocumentUploadProcess.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshDocumentUploadProcess.g.cs new file mode 100644 index 00000000..1d710712 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshDocumentUploadProcess.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshDocumentUploadProcessSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshDocumentUploadProcessSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshDocumentUploadProcessSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshDocumentUploadProcessArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshDocumentUploadProcessRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshDocumentUploadProcessResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshDocumentUploadProcessResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Document Upload Process + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshDocumentUploadProcessAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshDocumentUploadProcessAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Document Upload Process + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshDocumentUploadProcessAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshDocumentUploadProcessArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshDocumentUploadProcessSecurityRequirements, + operationName: "V1SolutionsKirshDocumentUploadProcessAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/kirsh-document-upload/process", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshDocumentUploadProcessRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshDocumentUploadProcess", + methodName: "V1SolutionsKirshDocumentUploadProcessAsync", + pathTemplate: "\"/solutions/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshDocumentUploadProcess", + methodName: "V1SolutionsKirshDocumentUploadProcessAsync", + pathTemplate: "\"/solutions/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshDocumentUploadProcess", + methodName: "V1SolutionsKirshDocumentUploadProcessAsync", + pathTemplate: "\"/solutions/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshDocumentUploadProcessResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshDocumentUploadProcess", + methodName: "V1SolutionsKirshDocumentUploadProcessAsync", + pathTemplate: "\"/solutions/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshDocumentUploadProcess", + methodName: "V1SolutionsKirshDocumentUploadProcessAsync", + pathTemplate: "\"/solutions/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshDocumentUploadProcessResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshEmailAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshEmailAssistant.g.cs new file mode 100644 index 00000000..6a3de7a8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshEmailAssistant.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshEmailAssistantSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshEmailAssistantSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshEmailAssistantSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshEmailAssistantArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshEmailAssistantRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshEmailAssistantResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshEmailAssistantResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Email Assistant + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshEmailAssistantAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshEmailAssistantAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Email Assistant + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshEmailAssistantAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshEmailAssistantArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshEmailAssistantSecurityRequirements, + operationName: "V1SolutionsKirshEmailAssistantAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/kirsh/email-assistant", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshEmailAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshEmailAssistant", + methodName: "V1SolutionsKirshEmailAssistantAsync", + pathTemplate: "\"/solutions/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshEmailAssistant", + methodName: "V1SolutionsKirshEmailAssistantAsync", + pathTemplate: "\"/solutions/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshEmailAssistant", + methodName: "V1SolutionsKirshEmailAssistantAsync", + pathTemplate: "\"/solutions/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshEmailAssistantResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshEmailAssistant", + methodName: "V1SolutionsKirshEmailAssistantAsync", + pathTemplate: "\"/solutions/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshEmailAssistant", + methodName: "V1SolutionsKirshEmailAssistantAsync", + pathTemplate: "\"/solutions/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshEmailAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs new file mode 100644 index 00000000..0f05edd5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshFundingAndCategorizationCheckSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshFundingAndCategorizationCheckSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshFundingAndCategorizationCheckSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshFundingAndCategorizationCheckArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshFundingAndCategorizationCheckRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshFundingAndCategorizationCheckResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshFundingAndCategorizationCheckResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Funding And Categorization Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshFundingAndCategorizationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshFundingAndCategorizationCheckAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Funding And Categorization Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshFundingAndCategorizationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshFundingAndCategorizationCheckArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshFundingAndCategorizationCheckSecurityRequirements, + operationName: "V1SolutionsKirshFundingAndCategorizationCheckAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/kirsh/funding-and-categorization-check", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshFundingAndCategorizationCheckRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshFundingAndCategorizationCheckResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshFundingAndCategorizationCheckResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantCompliance.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantCompliance.g.cs new file mode 100644 index 00000000..6d61fdf1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantCompliance.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshGrantComplianceSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshGrantComplianceSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshGrantComplianceSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshGrantComplianceArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshGrantComplianceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshGrantComplianceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshGrantComplianceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Grant Compliance + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshGrantComplianceAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshGrantComplianceAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Grant Compliance + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshGrantComplianceAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshGrantComplianceArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshGrantComplianceSecurityRequirements, + operationName: "V1SolutionsKirshGrantComplianceAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/kirsh/grant-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshGrantComplianceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantCompliance", + methodName: "V1SolutionsKirshGrantComplianceAsync", + pathTemplate: "\"/solutions/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantCompliance", + methodName: "V1SolutionsKirshGrantComplianceAsync", + pathTemplate: "\"/solutions/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantCompliance", + methodName: "V1SolutionsKirshGrantComplianceAsync", + pathTemplate: "\"/solutions/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshGrantComplianceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantCompliance", + methodName: "V1SolutionsKirshGrantComplianceAsync", + pathTemplate: "\"/solutions/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantCompliance", + methodName: "V1SolutionsKirshGrantComplianceAsync", + pathTemplate: "\"/solutions/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshGrantComplianceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantMetadata.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantMetadata.g.cs new file mode 100644 index 00000000..ae920271 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantMetadata.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshGrantMetadataSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshGrantMetadataSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshGrantMetadataSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshGrantMetadataArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshGrantMetadataRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshGrantMetadataResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshGrantMetadataResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Grant Metadata + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshGrantMetadataAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshGrantMetadataAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Grant Metadata + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshGrantMetadataAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshGrantMetadataArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshGrantMetadataSecurityRequirements, + operationName: "V1SolutionsKirshGrantMetadataAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/kirsh/grant-metadata", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshGrantMetadataRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantMetadata", + methodName: "V1SolutionsKirshGrantMetadataAsync", + pathTemplate: "\"/solutions/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantMetadata", + methodName: "V1SolutionsKirshGrantMetadataAsync", + pathTemplate: "\"/solutions/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantMetadata", + methodName: "V1SolutionsKirshGrantMetadataAsync", + pathTemplate: "\"/solutions/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshGrantMetadataResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantMetadata", + methodName: "V1SolutionsKirshGrantMetadataAsync", + pathTemplate: "\"/solutions/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshGrantMetadata", + methodName: "V1SolutionsKirshGrantMetadataAsync", + pathTemplate: "\"/solutions/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshGrantMetadataResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs new file mode 100644 index 00000000..8a2f5269 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshPreviewDocumentUploadProcessSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshPreviewDocumentUploadProcessSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshPreviewDocumentUploadProcessSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshPreviewDocumentUploadProcessArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshPreviewDocumentUploadProcessRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshPreviewDocumentUploadProcessResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshPreviewDocumentUploadProcessResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Document Upload Process Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshPreviewDocumentUploadProcessAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshPreviewDocumentUploadProcessAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Document Upload Process Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewDocumentUploadProcessAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshPreviewDocumentUploadProcessArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshPreviewDocumentUploadProcessSecurityRequirements, + operationName: "V1SolutionsKirshPreviewDocumentUploadProcessAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/kirsh-document-upload/process", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshPreviewDocumentUploadProcessRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewDocumentUploadProcess", + methodName: "V1SolutionsKirshPreviewDocumentUploadProcessAsync", + pathTemplate: "\"/solutions-preview/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewDocumentUploadProcess", + methodName: "V1SolutionsKirshPreviewDocumentUploadProcessAsync", + pathTemplate: "\"/solutions-preview/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewDocumentUploadProcess", + methodName: "V1SolutionsKirshPreviewDocumentUploadProcessAsync", + pathTemplate: "\"/solutions-preview/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshPreviewDocumentUploadProcessResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewDocumentUploadProcess", + methodName: "V1SolutionsKirshPreviewDocumentUploadProcessAsync", + pathTemplate: "\"/solutions-preview/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewDocumentUploadProcess", + methodName: "V1SolutionsKirshPreviewDocumentUploadProcessAsync", + pathTemplate: "\"/solutions-preview/kirsh-document-upload/process\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshPreviewDocumentUploadProcessResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs new file mode 100644 index 00000000..1ab06fe1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshPreviewEmailAssistantSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshPreviewEmailAssistantSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshPreviewEmailAssistantSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshPreviewEmailAssistantArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshPreviewEmailAssistantRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshPreviewEmailAssistantResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshPreviewEmailAssistantResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Email Assistant Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshPreviewEmailAssistantAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshPreviewEmailAssistantAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Email Assistant Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewEmailAssistantAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshPreviewEmailAssistantArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshPreviewEmailAssistantSecurityRequirements, + operationName: "V1SolutionsKirshPreviewEmailAssistantAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/kirsh/email-assistant", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshPreviewEmailAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewEmailAssistant", + methodName: "V1SolutionsKirshPreviewEmailAssistantAsync", + pathTemplate: "\"/solutions-preview/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewEmailAssistant", + methodName: "V1SolutionsKirshPreviewEmailAssistantAsync", + pathTemplate: "\"/solutions-preview/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewEmailAssistant", + methodName: "V1SolutionsKirshPreviewEmailAssistantAsync", + pathTemplate: "\"/solutions-preview/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshPreviewEmailAssistantResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewEmailAssistant", + methodName: "V1SolutionsKirshPreviewEmailAssistantAsync", + pathTemplate: "\"/solutions-preview/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewEmailAssistant", + methodName: "V1SolutionsKirshPreviewEmailAssistantAsync", + pathTemplate: "\"/solutions-preview/kirsh/email-assistant\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshPreviewEmailAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs new file mode 100644 index 00000000..4360bccb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshPreviewFundingAndCategorizationCheckSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshPreviewFundingAndCategorizationCheckSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshPreviewFundingAndCategorizationCheckSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshPreviewFundingAndCategorizationCheckArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshPreviewFundingAndCategorizationCheckRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshPreviewFundingAndCategorizationCheckResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshPreviewFundingAndCategorizationCheckResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Funding And Categorization Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshPreviewFundingAndCategorizationCheckAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Funding And Categorization Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewFundingAndCategorizationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshPreviewFundingAndCategorizationCheckArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshPreviewFundingAndCategorizationCheckSecurityRequirements, + operationName: "V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/kirsh/funding-and-categorization-check", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshPreviewFundingAndCategorizationCheckRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshPreviewFundingAndCategorizationCheckResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewFundingAndCategorizationCheck", + methodName: "V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/funding-and-categorization-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshPreviewFundingAndCategorizationCheckResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs new file mode 100644 index 00000000..ebc0ceb1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshPreviewGrantComplianceSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshPreviewGrantComplianceSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshPreviewGrantComplianceSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshPreviewGrantComplianceArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshPreviewGrantComplianceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshPreviewGrantComplianceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshPreviewGrantComplianceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Grant Compliance Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshPreviewGrantComplianceAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshPreviewGrantComplianceAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Grant Compliance Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewGrantComplianceAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshPreviewGrantComplianceArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshPreviewGrantComplianceSecurityRequirements, + operationName: "V1SolutionsKirshPreviewGrantComplianceAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/kirsh/grant-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshPreviewGrantComplianceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantCompliance", + methodName: "V1SolutionsKirshPreviewGrantComplianceAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantCompliance", + methodName: "V1SolutionsKirshPreviewGrantComplianceAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantCompliance", + methodName: "V1SolutionsKirshPreviewGrantComplianceAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshPreviewGrantComplianceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantCompliance", + methodName: "V1SolutionsKirshPreviewGrantComplianceAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantCompliance", + methodName: "V1SolutionsKirshPreviewGrantComplianceAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshPreviewGrantComplianceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs new file mode 100644 index 00000000..f3583b12 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshPreviewGrantMetadataSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshPreviewGrantMetadataSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshPreviewGrantMetadataSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshPreviewGrantMetadataArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshPreviewGrantMetadataRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshPreviewGrantMetadataResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshPreviewGrantMetadataResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Grant Metadata Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshPreviewGrantMetadataAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshPreviewGrantMetadataAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Grant Metadata Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewGrantMetadataAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshPreviewGrantMetadataArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshPreviewGrantMetadataSecurityRequirements, + operationName: "V1SolutionsKirshPreviewGrantMetadataAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/kirsh/grant-metadata", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshPreviewGrantMetadataRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantMetadata", + methodName: "V1SolutionsKirshPreviewGrantMetadataAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantMetadata", + methodName: "V1SolutionsKirshPreviewGrantMetadataAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantMetadata", + methodName: "V1SolutionsKirshPreviewGrantMetadataAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshPreviewGrantMetadataResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantMetadata", + methodName: "V1SolutionsKirshPreviewGrantMetadataAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewGrantMetadata", + methodName: "V1SolutionsKirshPreviewGrantMetadataAsync", + pathTemplate: "\"/solutions-preview/kirsh/grant-metadata\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshPreviewGrantMetadataResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs new file mode 100644 index 00000000..4079018b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshPreviewPublicInformationCheckSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshPreviewPublicInformationCheckSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshPreviewPublicInformationCheckSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshPreviewPublicInformationCheckArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshPreviewPublicInformationCheckRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshPreviewPublicInformationCheckResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshPreviewPublicInformationCheckResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Public Information Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshPreviewPublicInformationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshPreviewPublicInformationCheckAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Public Information Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewPublicInformationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshPreviewPublicInformationCheckArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshPreviewPublicInformationCheckSecurityRequirements, + operationName: "V1SolutionsKirshPreviewPublicInformationCheckAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/kirsh/public-information-check", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshPreviewPublicInformationCheckRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewPublicInformationCheck", + methodName: "V1SolutionsKirshPreviewPublicInformationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewPublicInformationCheck", + methodName: "V1SolutionsKirshPreviewPublicInformationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewPublicInformationCheck", + methodName: "V1SolutionsKirshPreviewPublicInformationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshPreviewPublicInformationCheckResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewPublicInformationCheck", + methodName: "V1SolutionsKirshPreviewPublicInformationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPreviewPublicInformationCheck", + methodName: "V1SolutionsKirshPreviewPublicInformationCheckAsync", + pathTemplate: "\"/solutions-preview/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshPreviewPublicInformationCheckResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPublicInformationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPublicInformationCheck.g.cs new file mode 100644 index 00000000..adc3e6c0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPublicInformationCheck.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsKirshPublicInformationCheckSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsKirshPublicInformationCheckSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsKirshPublicInformationCheckSecurityRequirement0, + }; + partial void PrepareV1SolutionsKirshPublicInformationCheckArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsKirshPublicInformationCheckRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsKirshPublicInformationCheckResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsKirshPublicInformationCheckResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Kirsh Public Information Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsKirshPublicInformationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsKirshPublicInformationCheckAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Kirsh Public Information Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsKirshPublicInformationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsKirshPublicInformationCheckArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsKirshPublicInformationCheckSecurityRequirements, + operationName: "V1SolutionsKirshPublicInformationCheckAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/kirsh/public-information-check", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsKirshPublicInformationCheckRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPublicInformationCheck", + methodName: "V1SolutionsKirshPublicInformationCheckAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPublicInformationCheck", + methodName: "V1SolutionsKirshPublicInformationCheckAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPublicInformationCheck", + methodName: "V1SolutionsKirshPublicInformationCheckAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsKirshPublicInformationCheckResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPublicInformationCheck", + methodName: "V1SolutionsKirshPublicInformationCheckAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsKirshPublicInformationCheck", + methodName: "V1SolutionsKirshPublicInformationCheckAsync", + pathTemplate: "\"/solutions/kirsh/public-information-check\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsKirshPublicInformationCheckResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs new file mode 100644 index 00000000..67d32783 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsTlvMunicipalityConvragSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsTlvMunicipalityConvragSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsTlvMunicipalityConvragSecurityRequirement0, + }; + partial void PrepareV1SolutionsTlvMunicipalityConvragArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsTlvMunicipalityConvragRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsTlvMunicipalityConvragResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsTlvMunicipalityConvragResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsTlvMunicipalityConvragAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsTlvMunicipalityConvragArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsTlvMunicipalityConvragSecurityRequirements, + operationName: "V1SolutionsTlvMunicipalityConvragAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/tlv_municipality/convrag", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsTlvMunicipalityConvragRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsTlvMunicipalityConvragResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsTlvMunicipalityConvragResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs new file mode 100644 index 00000000..1117c5e3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirement0, + }; + partial void PrepareV1SolutionsTlvMunicipalityPreviewConvragArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsTlvMunicipalityPreviewConvragRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsTlvMunicipalityPreviewConvragResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsTlvMunicipalityPreviewConvragResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityPreviewConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsTlvMunicipalityPreviewConvragAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityPreviewConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsTlvMunicipalityPreviewConvragArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirements, + operationName: "V1SolutionsTlvMunicipalityPreviewConvragAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/tlv_municipality/convrag", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsTlvMunicipalityPreviewConvragRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsTlvMunicipalityPreviewConvragResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsTlvMunicipalityPreviewConvragResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaActionItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaActionItems.g.cs new file mode 100644 index 00000000..0119e4bf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaActionItems.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaActionItemsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaActionItemsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaActionItemsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaActionItemsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaActionItemsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaActionItemsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaActionItemsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Action Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaActionItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaActionItemsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Action Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaActionItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaActionItemsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaActionItemsSecurityRequirements, + operationName: "V1SolutionsVidaaActionItemsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/action-items", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaActionItemsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaActionItems", + methodName: "V1SolutionsVidaaActionItemsAsync", + pathTemplate: "\"/solutions/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaActionItems", + methodName: "V1SolutionsVidaaActionItemsAsync", + pathTemplate: "\"/solutions/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaActionItems", + methodName: "V1SolutionsVidaaActionItemsAsync", + pathTemplate: "\"/solutions/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaActionItemsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaActionItems", + methodName: "V1SolutionsVidaaActionItemsAsync", + pathTemplate: "\"/solutions/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaActionItems", + methodName: "V1SolutionsVidaaActionItemsAsync", + pathTemplate: "\"/solutions/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaActionItemsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaApiMessages.g.cs new file mode 100644 index 00000000..5b5b9f62 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaApiMessages.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaApiMessagesSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaApiMessagesSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaApiMessagesSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaApiMessagesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaApiMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaApiMessagesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaApiMessagesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaApiMessagesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaApiMessagesArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaApiMessagesSecurityRequirements, + operationName: "V1SolutionsVidaaApiMessagesAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/api/messages", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaApiMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaApiMessages", + methodName: "V1SolutionsVidaaApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaApiMessages", + methodName: "V1SolutionsVidaaApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaApiMessages", + methodName: "V1SolutionsVidaaApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaApiMessagesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaApiMessages", + methodName: "V1SolutionsVidaaApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaApiMessages", + methodName: "V1SolutionsVidaaApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaApiMessagesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentApiMessages.g.cs new file mode 100644 index 00000000..325a0bf7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentApiMessages.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentApiMessagesSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentApiMessagesSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentApiMessagesSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentApiMessagesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaContentApiMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaContentApiMessagesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentApiMessagesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentApiMessagesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentApiMessagesArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentApiMessagesSecurityRequirements, + operationName: "V1SolutionsVidaaContentApiMessagesAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/content/api/messages", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentApiMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentApiMessages", + methodName: "V1SolutionsVidaaContentApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentApiMessages", + methodName: "V1SolutionsVidaaContentApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentApiMessages", + methodName: "V1SolutionsVidaaContentApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentApiMessagesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentApiMessages", + methodName: "V1SolutionsVidaaContentApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentApiMessages", + methodName: "V1SolutionsVidaaContentApiMessagesAsync", + pathTemplate: "\"/solutions/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentApiMessagesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBrief.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBrief.g.cs new file mode 100644 index 00000000..66febe06 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBrief.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentBriefSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentBriefSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentBriefSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentBriefArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaContentBriefRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaContentBriefResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentBriefResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentBriefAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentBriefArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentBriefSecurityRequirements, + operationName: "V1SolutionsVidaaContentBriefAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/content/brief", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentBriefRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBrief", + methodName: "V1SolutionsVidaaContentBriefAsync", + pathTemplate: "\"/solutions/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBrief", + methodName: "V1SolutionsVidaaContentBriefAsync", + pathTemplate: "\"/solutions/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBrief", + methodName: "V1SolutionsVidaaContentBriefAsync", + pathTemplate: "\"/solutions/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentBriefResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBrief", + methodName: "V1SolutionsVidaaContentBriefAsync", + pathTemplate: "\"/solutions/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBrief", + methodName: "V1SolutionsVidaaContentBriefAsync", + pathTemplate: "\"/solutions/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentBriefResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobs.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobs.g.cs new file mode 100644 index 00000000..db760003 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobs.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentBriefJobsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentBriefJobsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentBriefJobsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentBriefJobsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaContentBriefJobsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaContentBriefJobsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentBriefJobsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefJobsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentBriefJobsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefJobsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentBriefJobsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentBriefJobsSecurityRequirements, + operationName: "V1SolutionsVidaaContentBriefJobsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/content/brief/jobs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentBriefJobsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobs", + methodName: "V1SolutionsVidaaContentBriefJobsAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobs", + methodName: "V1SolutionsVidaaContentBriefJobsAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobs", + methodName: "V1SolutionsVidaaContentBriefJobsAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentBriefJobsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobs", + methodName: "V1SolutionsVidaaContentBriefJobsAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobs", + methodName: "V1SolutionsVidaaContentBriefJobsAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentBriefJobsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs new file mode 100644 index 00000000..fef84cb9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentBriefJobsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentBriefJobsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentBriefJobsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentBriefJobsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string jobId); + partial void PrepareV1SolutionsVidaaContentBriefJobsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string jobId); + partial void ProcessV1SolutionsVidaaContentBriefJobsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentBriefJobsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief Jobs Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefJobsStatusAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentBriefJobsStatusAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief Jobs Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefJobsStatusAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentBriefJobsStatusArguments( + httpClient: HttpClient, + jobId: ref jobId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentBriefJobsStatusSecurityRequirements, + operationName: "V1SolutionsVidaaContentBriefJobsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/vidaa/content/brief/jobs/{jobId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentBriefJobsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + jobId: jobId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobsStatus", + methodName: "V1SolutionsVidaaContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobsStatus", + methodName: "V1SolutionsVidaaContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobsStatus", + methodName: "V1SolutionsVidaaContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentBriefJobsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobsStatus", + methodName: "V1SolutionsVidaaContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefJobsStatus", + methodName: "V1SolutionsVidaaContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions/vidaa/content/brief/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentBriefJobsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefScheduled.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefScheduled.g.cs new file mode 100644 index 00000000..7e8d7e4c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefScheduled.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentBriefScheduledSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentBriefScheduledSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentBriefScheduledSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentBriefScheduledArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaContentBriefScheduledRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaContentBriefScheduledResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentBriefScheduledResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief Scheduled + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefScheduledAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentBriefScheduledAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief Scheduled + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefScheduledAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentBriefScheduledArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentBriefScheduledSecurityRequirements, + operationName: "V1SolutionsVidaaContentBriefScheduledAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/content/brief/scheduled", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentBriefScheduledRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefScheduled", + methodName: "V1SolutionsVidaaContentBriefScheduledAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefScheduled", + methodName: "V1SolutionsVidaaContentBriefScheduledAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefScheduled", + methodName: "V1SolutionsVidaaContentBriefScheduledAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentBriefScheduledResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefScheduled", + methodName: "V1SolutionsVidaaContentBriefScheduledAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentBriefScheduled", + methodName: "V1SolutionsVidaaContentBriefScheduledAsync", + pathTemplate: "\"/solutions/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentBriefScheduledResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscribe.g.cs new file mode 100644 index 00000000..6be4eb51 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentSubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentSubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentSubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentSubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaContentSubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaContentSubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentSubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentSubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentSubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentSubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaContentSubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/content/subscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentSubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscribe", + methodName: "V1SolutionsVidaaContentSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscribe", + methodName: "V1SolutionsVidaaContentSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscribe", + methodName: "V1SolutionsVidaaContentSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentSubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscribe", + methodName: "V1SolutionsVidaaContentSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscribe", + methodName: "V1SolutionsVidaaContentSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentSubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscriptions.g.cs new file mode 100644 index 00000000..39644728 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentSubscriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentSubscriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentSubscriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentSubscriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaContentSubscriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaContentSubscriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentSubscriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentSubscriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentSubscriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentSubscriptionsSecurityRequirements, + operationName: "V1SolutionsVidaaContentSubscriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/content/subscriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentSubscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscriptions", + methodName: "V1SolutionsVidaaContentSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscriptions", + methodName: "V1SolutionsVidaaContentSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscriptions", + methodName: "V1SolutionsVidaaContentSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentSubscriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscriptions", + methodName: "V1SolutionsVidaaContentSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentSubscriptions", + methodName: "V1SolutionsVidaaContentSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/content/subscriptions\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentSubscriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentUnsubscribe.g.cs new file mode 100644 index 00000000..3539facf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentUnsubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaContentUnsubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaContentUnsubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaContentUnsubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaContentUnsubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaContentUnsubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaContentUnsubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaContentUnsubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaContentUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaContentUnsubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaContentUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaContentUnsubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaContentUnsubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaContentUnsubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/content/unsubscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaContentUnsubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentUnsubscribe", + methodName: "V1SolutionsVidaaContentUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentUnsubscribe", + methodName: "V1SolutionsVidaaContentUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentUnsubscribe", + methodName: "V1SolutionsVidaaContentUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaContentUnsubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentUnsubscribe", + methodName: "V1SolutionsVidaaContentUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaContentUnsubscribe", + methodName: "V1SolutionsVidaaContentUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaContentUnsubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaFeedItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaFeedItems.g.cs new file mode 100644 index 00000000..519dd1d9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaFeedItems.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaFeedItemsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaFeedItemsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaFeedItemsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaFeedItemsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaFeedItemsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaFeedItemsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaFeedItemsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Feed Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaFeedItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaFeedItemsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Feed Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaFeedItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaFeedItemsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaFeedItemsSecurityRequirements, + operationName: "V1SolutionsVidaaFeedItemsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/feed-items", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaFeedItemsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaFeedItems", + methodName: "V1SolutionsVidaaFeedItemsAsync", + pathTemplate: "\"/solutions/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaFeedItems", + methodName: "V1SolutionsVidaaFeedItemsAsync", + pathTemplate: "\"/solutions/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaFeedItems", + methodName: "V1SolutionsVidaaFeedItemsAsync", + pathTemplate: "\"/solutions/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaFeedItemsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaFeedItems", + methodName: "V1SolutionsVidaaFeedItemsAsync", + pathTemplate: "\"/solutions/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaFeedItems", + methodName: "V1SolutionsVidaaFeedItemsAsync", + pathTemplate: "\"/solutions/vidaa/feed-items\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaFeedItemsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewActionItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewActionItems.g.cs new file mode 100644 index 00000000..d589f3f3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewActionItems.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewActionItemsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewActionItemsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewActionItemsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewActionItemsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewActionItemsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewActionItemsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewActionItemsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Action Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewActionItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewActionItemsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Action Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewActionItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewActionItemsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewActionItemsSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewActionItemsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/action-items", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewActionItemsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewActionItems", + methodName: "V1SolutionsVidaaPreviewActionItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewActionItems", + methodName: "V1SolutionsVidaaPreviewActionItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewActionItems", + methodName: "V1SolutionsVidaaPreviewActionItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewActionItemsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewActionItems", + methodName: "V1SolutionsVidaaPreviewActionItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewActionItems", + methodName: "V1SolutionsVidaaPreviewActionItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/action-items\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewActionItemsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewApiMessages.g.cs new file mode 100644 index 00000000..d8260546 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewApiMessages.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewApiMessagesSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewApiMessagesSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewApiMessagesSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewApiMessagesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewApiMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewApiMessagesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewApiMessagesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewApiMessagesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewApiMessagesArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewApiMessagesSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewApiMessagesAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/api/messages", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewApiMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewApiMessages", + methodName: "V1SolutionsVidaaPreviewApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewApiMessages", + methodName: "V1SolutionsVidaaPreviewApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewApiMessages", + methodName: "V1SolutionsVidaaPreviewApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewApiMessagesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewApiMessages", + methodName: "V1SolutionsVidaaPreviewApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewApiMessages", + methodName: "V1SolutionsVidaaPreviewApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewApiMessagesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs new file mode 100644 index 00000000..afcfd916 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentApiMessagesSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentApiMessagesSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentApiMessagesSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentApiMessagesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewContentApiMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewContentApiMessagesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentApiMessagesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentApiMessagesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentApiMessagesArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentApiMessagesSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentApiMessagesAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/content/api/messages", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentApiMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentApiMessages", + methodName: "V1SolutionsVidaaPreviewContentApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentApiMessages", + methodName: "V1SolutionsVidaaPreviewContentApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentApiMessages", + methodName: "V1SolutionsVidaaPreviewContentApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentApiMessagesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentApiMessages", + methodName: "V1SolutionsVidaaPreviewContentApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentApiMessages", + methodName: "V1SolutionsVidaaPreviewContentApiMessagesAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/api/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentApiMessagesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBrief.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBrief.g.cs new file mode 100644 index 00000000..1155a2d5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBrief.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentBriefSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentBriefSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentBriefSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentBriefArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewContentBriefRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewContentBriefResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentBriefResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentBriefAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentBriefArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentBriefSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentBriefAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/content/brief", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentBriefRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBrief", + methodName: "V1SolutionsVidaaPreviewContentBriefAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBrief", + methodName: "V1SolutionsVidaaPreviewContentBriefAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBrief", + methodName: "V1SolutionsVidaaPreviewContentBriefAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentBriefResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBrief", + methodName: "V1SolutionsVidaaPreviewContentBriefAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBrief", + methodName: "V1SolutionsVidaaPreviewContentBriefAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentBriefResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs new file mode 100644 index 00000000..713e6aae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentBriefJobsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentBriefJobsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentBriefJobsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentBriefJobsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewContentBriefJobsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewContentBriefJobsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentBriefJobsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief Jobs Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefJobsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentBriefJobsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief Jobs Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefJobsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentBriefJobsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentBriefJobsSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentBriefJobsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/content/brief/jobs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentBriefJobsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobs", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobs", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobs", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentBriefJobsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobs", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobs", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/jobs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentBriefJobsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs new file mode 100644 index 00000000..350b8357 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentBriefJobsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentBriefJobsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentBriefJobsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentBriefJobsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string jobId); + partial void PrepareV1SolutionsVidaaPreviewContentBriefJobsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string jobId); + partial void ProcessV1SolutionsVidaaPreviewContentBriefJobsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentBriefJobsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief Jobs Status Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefJobsStatusAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentBriefJobsStatusAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief Jobs Status Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefJobsStatusAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentBriefJobsStatusArguments( + httpClient: HttpClient, + jobId: ref jobId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentBriefJobsStatusSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentBriefJobsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/vidaa/content/brief/jobs/{jobId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentBriefJobsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + jobId: jobId!); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobsStatus", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions-preview/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobsStatus", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions-preview/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobsStatus", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions-preview/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentBriefJobsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobsStatus", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions-preview/vidaa/content/brief/jobs/{jobId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefJobsStatus", + methodName: "V1SolutionsVidaaPreviewContentBriefJobsStatusAsync", + pathTemplate: "$\"/solutions-preview/vidaa/content/brief/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentBriefJobsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs new file mode 100644 index 00000000..15a44aef --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentBriefScheduledSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentBriefScheduledSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentBriefScheduledSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentBriefScheduledArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewContentBriefScheduledRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewContentBriefScheduledResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentBriefScheduledResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Brief Scheduled Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefScheduledAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentBriefScheduledAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Brief Scheduled Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefScheduledAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentBriefScheduledArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentBriefScheduledSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentBriefScheduledAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/content/brief/scheduled", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentBriefScheduledRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefScheduled", + methodName: "V1SolutionsVidaaPreviewContentBriefScheduledAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefScheduled", + methodName: "V1SolutionsVidaaPreviewContentBriefScheduledAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefScheduled", + methodName: "V1SolutionsVidaaPreviewContentBriefScheduledAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentBriefScheduledResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefScheduled", + methodName: "V1SolutionsVidaaPreviewContentBriefScheduledAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentBriefScheduled", + methodName: "V1SolutionsVidaaPreviewContentBriefScheduledAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/brief/scheduled\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentBriefScheduledResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs new file mode 100644 index 00000000..ab2f5c4f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentSubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentSubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentSubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentSubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewContentSubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewContentSubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentSubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentSubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentSubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentSubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentSubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/content/subscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentSubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscribe", + methodName: "V1SolutionsVidaaPreviewContentSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscribe", + methodName: "V1SolutionsVidaaPreviewContentSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscribe", + methodName: "V1SolutionsVidaaPreviewContentSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentSubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscribe", + methodName: "V1SolutionsVidaaPreviewContentSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscribe", + methodName: "V1SolutionsVidaaPreviewContentSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentSubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs new file mode 100644 index 00000000..3bf19b24 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentSubscriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentSubscriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentSubscriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentSubscriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewContentSubscriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewContentSubscriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentSubscriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentSubscriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentSubscriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentSubscriptionsSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentSubscriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/content/subscriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentSubscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscriptions", + methodName: "V1SolutionsVidaaPreviewContentSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscriptions", + methodName: "V1SolutionsVidaaPreviewContentSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscriptions", + methodName: "V1SolutionsVidaaPreviewContentSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentSubscriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscriptions", + methodName: "V1SolutionsVidaaPreviewContentSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentSubscriptions", + methodName: "V1SolutionsVidaaPreviewContentSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/subscriptions\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentSubscriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs new file mode 100644 index 00000000..a9e4d899 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewContentUnsubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewContentUnsubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewContentUnsubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewContentUnsubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewContentUnsubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewContentUnsubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewContentUnsubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Content Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewContentUnsubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Content Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewContentUnsubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewContentUnsubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewContentUnsubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/content/unsubscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewContentUnsubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentUnsubscribe", + methodName: "V1SolutionsVidaaPreviewContentUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentUnsubscribe", + methodName: "V1SolutionsVidaaPreviewContentUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentUnsubscribe", + methodName: "V1SolutionsVidaaPreviewContentUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewContentUnsubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentUnsubscribe", + methodName: "V1SolutionsVidaaPreviewContentUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewContentUnsubscribe", + methodName: "V1SolutionsVidaaPreviewContentUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/content/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewContentUnsubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewFeedItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewFeedItems.g.cs new file mode 100644 index 00000000..788e5e62 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewFeedItems.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewFeedItemsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewFeedItemsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewFeedItemsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewFeedItemsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewFeedItemsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewFeedItemsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewFeedItemsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Feed Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewFeedItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewFeedItemsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Feed Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewFeedItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewFeedItemsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewFeedItemsSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewFeedItemsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/feed-items", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewFeedItemsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewFeedItems", + methodName: "V1SolutionsVidaaPreviewFeedItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewFeedItems", + methodName: "V1SolutionsVidaaPreviewFeedItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewFeedItems", + methodName: "V1SolutionsVidaaPreviewFeedItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewFeedItemsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewFeedItems", + methodName: "V1SolutionsVidaaPreviewFeedItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/feed-items\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewFeedItems", + methodName: "V1SolutionsVidaaPreviewFeedItemsAsync", + pathTemplate: "\"/solutions-preview/vidaa/feed-items\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewFeedItemsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs new file mode 100644 index 00000000..01fcf6b4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewSchedulerStatsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewSchedulerStatsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewSchedulerStatsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewSchedulerStatsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewSchedulerStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewSchedulerStatsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewSchedulerStatsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Scheduler Stats Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSchedulerStatsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewSchedulerStatsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Scheduler Stats Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSchedulerStatsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewSchedulerStatsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewSchedulerStatsSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewSchedulerStatsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/scheduler-stats", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewSchedulerStatsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSchedulerStats", + methodName: "V1SolutionsVidaaPreviewSchedulerStatsAsync", + pathTemplate: "\"/solutions-preview/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSchedulerStats", + methodName: "V1SolutionsVidaaPreviewSchedulerStatsAsync", + pathTemplate: "\"/solutions-preview/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSchedulerStats", + methodName: "V1SolutionsVidaaPreviewSchedulerStatsAsync", + pathTemplate: "\"/solutions-preview/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewSchedulerStatsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSchedulerStats", + methodName: "V1SolutionsVidaaPreviewSchedulerStatsAsync", + pathTemplate: "\"/solutions-preview/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSchedulerStats", + methodName: "V1SolutionsVidaaPreviewSchedulerStatsAsync", + pathTemplate: "\"/solutions-preview/vidaa/scheduler-stats\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewSchedulerStatsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSources.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSources.g.cs new file mode 100644 index 00000000..a52c92c7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSources.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewSourcesSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewSourcesSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewSourcesSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewSourcesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewSourcesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewSourcesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewSourcesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Sources Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSourcesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewSourcesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Sources Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSourcesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewSourcesArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewSourcesSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewSourcesAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/sources", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewSourcesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSources", + methodName: "V1SolutionsVidaaPreviewSourcesAsync", + pathTemplate: "\"/solutions-preview/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSources", + methodName: "V1SolutionsVidaaPreviewSourcesAsync", + pathTemplate: "\"/solutions-preview/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSources", + methodName: "V1SolutionsVidaaPreviewSourcesAsync", + pathTemplate: "\"/solutions-preview/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewSourcesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSources", + methodName: "V1SolutionsVidaaPreviewSourcesAsync", + pathTemplate: "\"/solutions-preview/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSources", + methodName: "V1SolutionsVidaaPreviewSourcesAsync", + pathTemplate: "\"/solutions-preview/vidaa/sources\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewSourcesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscribe.g.cs new file mode 100644 index 00000000..52876fab --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewSubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewSubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewSubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewSubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewSubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewSubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewSubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewSubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewSubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewSubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewSubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/subscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewSubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscribe", + methodName: "V1SolutionsVidaaPreviewSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscribe", + methodName: "V1SolutionsVidaaPreviewSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscribe", + methodName: "V1SolutionsVidaaPreviewSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewSubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscribe", + methodName: "V1SolutionsVidaaPreviewSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscribe", + methodName: "V1SolutionsVidaaPreviewSubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewSubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs new file mode 100644 index 00000000..90b493a0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewSubscriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewSubscriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewSubscriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewSubscriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewSubscriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewSubscriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewSubscriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewSubscriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewSubscriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewSubscriptionsSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewSubscriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/subscriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewSubscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscriptions", + methodName: "V1SolutionsVidaaPreviewSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscriptions", + methodName: "V1SolutionsVidaaPreviewSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscriptions", + methodName: "V1SolutionsVidaaPreviewSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewSubscriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscriptions", + methodName: "V1SolutionsVidaaPreviewSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSubscriptions", + methodName: "V1SolutionsVidaaPreviewSubscriptionsAsync", + pathTemplate: "\"/solutions-preview/vidaa/subscriptions\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewSubscriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSummarize.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSummarize.g.cs new file mode 100644 index 00000000..6cf0f9d3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSummarize.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewSummarizeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewSummarizeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewSummarizeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewSummarizeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewSummarizeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewSummarizeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewSummarizeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Summarize Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSummarizeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewSummarizeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Summarize Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSummarizeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewSummarizeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewSummarizeSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewSummarizeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/summarize", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewSummarizeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSummarize", + methodName: "V1SolutionsVidaaPreviewSummarizeAsync", + pathTemplate: "\"/solutions-preview/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSummarize", + methodName: "V1SolutionsVidaaPreviewSummarizeAsync", + pathTemplate: "\"/solutions-preview/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSummarize", + methodName: "V1SolutionsVidaaPreviewSummarizeAsync", + pathTemplate: "\"/solutions-preview/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewSummarizeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSummarize", + methodName: "V1SolutionsVidaaPreviewSummarizeAsync", + pathTemplate: "\"/solutions-preview/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewSummarize", + methodName: "V1SolutionsVidaaPreviewSummarizeAsync", + pathTemplate: "\"/solutions-preview/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewSummarizeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs new file mode 100644 index 00000000..67c6788a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewTriggerPollSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewTriggerPollSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewTriggerPollSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewTriggerPollArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewTriggerPollRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewTriggerPollResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewTriggerPollResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Trigger Poll Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewTriggerPollAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewTriggerPollAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Trigger Poll Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewTriggerPollAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewTriggerPollArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewTriggerPollSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewTriggerPollAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/trigger-poll", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewTriggerPollRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewTriggerPoll", + methodName: "V1SolutionsVidaaPreviewTriggerPollAsync", + pathTemplate: "\"/solutions-preview/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewTriggerPoll", + methodName: "V1SolutionsVidaaPreviewTriggerPollAsync", + pathTemplate: "\"/solutions-preview/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewTriggerPoll", + methodName: "V1SolutionsVidaaPreviewTriggerPollAsync", + pathTemplate: "\"/solutions-preview/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewTriggerPollResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewTriggerPoll", + methodName: "V1SolutionsVidaaPreviewTriggerPollAsync", + pathTemplate: "\"/solutions-preview/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewTriggerPoll", + methodName: "V1SolutionsVidaaPreviewTriggerPollAsync", + pathTemplate: "\"/solutions-preview/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewTriggerPollResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs new file mode 100644 index 00000000..a0db528b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaPreviewUnsubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaPreviewUnsubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaPreviewUnsubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaPreviewUnsubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaPreviewUnsubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaPreviewUnsubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaPreviewUnsubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaPreviewUnsubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaPreviewUnsubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaPreviewUnsubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaPreviewUnsubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/vidaa/unsubscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaPreviewUnsubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewUnsubscribe", + methodName: "V1SolutionsVidaaPreviewUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewUnsubscribe", + methodName: "V1SolutionsVidaaPreviewUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewUnsubscribe", + methodName: "V1SolutionsVidaaPreviewUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaPreviewUnsubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewUnsubscribe", + methodName: "V1SolutionsVidaaPreviewUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaPreviewUnsubscribe", + methodName: "V1SolutionsVidaaPreviewUnsubscribeAsync", + pathTemplate: "\"/solutions-preview/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaPreviewUnsubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSchedulerStats.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSchedulerStats.g.cs new file mode 100644 index 00000000..8b0730d3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSchedulerStats.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaSchedulerStatsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaSchedulerStatsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaSchedulerStatsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaSchedulerStatsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaSchedulerStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaSchedulerStatsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaSchedulerStatsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Scheduler Stats + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaSchedulerStatsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaSchedulerStatsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Scheduler Stats + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaSchedulerStatsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaSchedulerStatsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaSchedulerStatsSecurityRequirements, + operationName: "V1SolutionsVidaaSchedulerStatsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/scheduler-stats", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaSchedulerStatsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSchedulerStats", + methodName: "V1SolutionsVidaaSchedulerStatsAsync", + pathTemplate: "\"/solutions/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSchedulerStats", + methodName: "V1SolutionsVidaaSchedulerStatsAsync", + pathTemplate: "\"/solutions/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSchedulerStats", + methodName: "V1SolutionsVidaaSchedulerStatsAsync", + pathTemplate: "\"/solutions/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaSchedulerStatsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSchedulerStats", + methodName: "V1SolutionsVidaaSchedulerStatsAsync", + pathTemplate: "\"/solutions/vidaa/scheduler-stats\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSchedulerStats", + methodName: "V1SolutionsVidaaSchedulerStatsAsync", + pathTemplate: "\"/solutions/vidaa/scheduler-stats\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaSchedulerStatsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSources.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSources.g.cs new file mode 100644 index 00000000..11f438f2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSources.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaSourcesSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaSourcesSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaSourcesSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaSourcesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaSourcesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaSourcesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaSourcesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Sources + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaSourcesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaSourcesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Sources + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaSourcesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaSourcesArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaSourcesSecurityRequirements, + operationName: "V1SolutionsVidaaSourcesAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/sources", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaSourcesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSources", + methodName: "V1SolutionsVidaaSourcesAsync", + pathTemplate: "\"/solutions/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSources", + methodName: "V1SolutionsVidaaSourcesAsync", + pathTemplate: "\"/solutions/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSources", + methodName: "V1SolutionsVidaaSourcesAsync", + pathTemplate: "\"/solutions/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaSourcesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSources", + methodName: "V1SolutionsVidaaSourcesAsync", + pathTemplate: "\"/solutions/vidaa/sources\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSources", + methodName: "V1SolutionsVidaaSourcesAsync", + pathTemplate: "\"/solutions/vidaa/sources\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaSourcesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscribe.g.cs new file mode 100644 index 00000000..250bd461 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaSubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaSubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaSubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaSubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaSubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaSubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaSubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaSubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaSubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaSubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaSubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/subscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaSubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscribe", + methodName: "V1SolutionsVidaaSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscribe", + methodName: "V1SolutionsVidaaSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscribe", + methodName: "V1SolutionsVidaaSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaSubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscribe", + methodName: "V1SolutionsVidaaSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscribe", + methodName: "V1SolutionsVidaaSubscribeAsync", + pathTemplate: "\"/solutions/vidaa/subscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaSubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscriptions.g.cs new file mode 100644 index 00000000..a47e6fc7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaSubscriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaSubscriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaSubscriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaSubscriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaSubscriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaSubscriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaSubscriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaSubscriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaSubscriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaSubscriptionsSecurityRequirements, + operationName: "V1SolutionsVidaaSubscriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/subscriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaSubscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscriptions", + methodName: "V1SolutionsVidaaSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscriptions", + methodName: "V1SolutionsVidaaSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscriptions", + methodName: "V1SolutionsVidaaSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaSubscriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscriptions", + methodName: "V1SolutionsVidaaSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/subscriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSubscriptions", + methodName: "V1SolutionsVidaaSubscriptionsAsync", + pathTemplate: "\"/solutions/vidaa/subscriptions\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaSubscriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSummarize.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSummarize.g.cs new file mode 100644 index 00000000..e3fa419c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSummarize.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaSummarizeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaSummarizeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaSummarizeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaSummarizeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaSummarizeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaSummarizeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaSummarizeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Summarize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaSummarizeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaSummarizeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Summarize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaSummarizeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaSummarizeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaSummarizeSecurityRequirements, + operationName: "V1SolutionsVidaaSummarizeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/summarize", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaSummarizeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSummarize", + methodName: "V1SolutionsVidaaSummarizeAsync", + pathTemplate: "\"/solutions/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSummarize", + methodName: "V1SolutionsVidaaSummarizeAsync", + pathTemplate: "\"/solutions/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSummarize", + methodName: "V1SolutionsVidaaSummarizeAsync", + pathTemplate: "\"/solutions/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaSummarizeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSummarize", + methodName: "V1SolutionsVidaaSummarizeAsync", + pathTemplate: "\"/solutions/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaSummarize", + methodName: "V1SolutionsVidaaSummarizeAsync", + pathTemplate: "\"/solutions/vidaa/summarize\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaSummarizeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaTriggerPoll.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaTriggerPoll.g.cs new file mode 100644 index 00000000..7d31be74 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaTriggerPoll.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaTriggerPollSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaTriggerPollSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaTriggerPollSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaTriggerPollArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaTriggerPollRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaTriggerPollResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaTriggerPollResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Trigger Poll + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaTriggerPollAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaTriggerPollAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Trigger Poll + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaTriggerPollAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaTriggerPollArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaTriggerPollSecurityRequirements, + operationName: "V1SolutionsVidaaTriggerPollAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/trigger-poll", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaTriggerPollRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaTriggerPoll", + methodName: "V1SolutionsVidaaTriggerPollAsync", + pathTemplate: "\"/solutions/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaTriggerPoll", + methodName: "V1SolutionsVidaaTriggerPollAsync", + pathTemplate: "\"/solutions/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaTriggerPoll", + methodName: "V1SolutionsVidaaTriggerPollAsync", + pathTemplate: "\"/solutions/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaTriggerPollResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaTriggerPoll", + methodName: "V1SolutionsVidaaTriggerPollAsync", + pathTemplate: "\"/solutions/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaTriggerPoll", + methodName: "V1SolutionsVidaaTriggerPollAsync", + pathTemplate: "\"/solutions/vidaa/trigger-poll\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaTriggerPollResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaUnsubscribe.g.cs new file mode 100644 index 00000000..d51df0f7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaUnsubscribe.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsVidaaUnsubscribeSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsVidaaUnsubscribeSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsVidaaUnsubscribeSecurityRequirement0, + }; + partial void PrepareV1SolutionsVidaaUnsubscribeArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsVidaaUnsubscribeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsVidaaUnsubscribeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsVidaaUnsubscribeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Vidaa Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsVidaaUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsVidaaUnsubscribeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Vidaa Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsVidaaUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsVidaaUnsubscribeArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsVidaaUnsubscribeSecurityRequirements, + operationName: "V1SolutionsVidaaUnsubscribeAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/vidaa/unsubscribe", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsVidaaUnsubscribeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaUnsubscribe", + methodName: "V1SolutionsVidaaUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaUnsubscribe", + methodName: "V1SolutionsVidaaUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaUnsubscribe", + methodName: "V1SolutionsVidaaUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsVidaaUnsubscribeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaUnsubscribe", + methodName: "V1SolutionsVidaaUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsVidaaUnsubscribe", + methodName: "V1SolutionsVidaaUnsubscribeAsync", + pathTemplate: "\"/solutions/vidaa/unsubscribe\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsVidaaUnsubscribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs index 97aeeef9..41b8c674 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1StudioApiGenerationRequirementsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Requirements + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1StudioApiGenerationRequirementsAsResponseAsync( + + global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( securityRequirements: s_V1StudioApiGenerationRequirementsSecurityRequirements, operationName: "V1StudioApiGenerationRequirementsAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/generation/requirements", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/generation/requirements", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,165 +137,347 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1StudioApiGenerationRequirementsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1StudioApiGenerationRequirementsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1StudioApiGenerationRequirementsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1StudioApiGenerationRequirementsResponseContent( + response: __response); + ProcessV1StudioApiGenerationRequirementsResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.RequirementsGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.RequirementsGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1StudioApiGenerationRequirementsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.RequirementsGenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.RequirementsGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( string query, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.RequirementsGenerationRequest @@ -258,6 +487,7 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( return await V1StudioApiGenerationRequirementsAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationThreadName.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationThreadName.g.cs index 7ca9b988..814b0096 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationThreadName.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationThreadName.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1StudioApiGenerationThreadNameResponseContent( /// Generate Thread Name /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( global::AI21.ThreadNameGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1StudioApiGenerationThreadNameAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Thread Name + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1StudioApiGenerationThreadNameAsResponseAsync( + + global::AI21.ThreadNameGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1StudioApiGenerationThreadNameResponseContent( securityRequirements: s_V1StudioApiGenerationThreadNameSecurityRequirements, operationName: "V1StudioApiGenerationThreadNameAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/generation/thread-name", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/generation/thread-name", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,165 +137,347 @@ partial void ProcessV1StudioApiGenerationThreadNameResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1StudioApiGenerationThreadNameRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1StudioApiGenerationThreadNameRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1StudioApiGenerationThreadNameResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationThreadName", + methodName: "V1StudioApiGenerationThreadNameAsync", + pathTemplate: "\"/studio/v1/generation/thread-name\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationThreadName", + methodName: "V1StudioApiGenerationThreadNameAsync", + pathTemplate: "\"/studio/v1/generation/thread-name\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationThreadName", + methodName: "V1StudioApiGenerationThreadNameAsync", + pathTemplate: "\"/studio/v1/generation/thread-name\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1StudioApiGenerationThreadNameResponseContent( + response: __response); + ProcessV1StudioApiGenerationThreadNameResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ThreadNameGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationThreadName", + methodName: "V1StudioApiGenerationThreadNameAsync", + pathTemplate: "\"/studio/v1/generation/thread-name\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationThreadName", + methodName: "V1StudioApiGenerationThreadNameAsync", + pathTemplate: "\"/studio/v1/generation/thread-name\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ThreadNameGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1StudioApiGenerationThreadNameResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ThreadNameGenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ThreadNameGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Generate Thread Name /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( string query, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.ThreadNameGenerationRequest @@ -258,6 +487,7 @@ partial void ProcessV1StudioApiGenerationThreadNameResponseContent( return await V1StudioApiGenerationThreadNameAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs index 894e60ab..06bc2a98 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1ValidatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ValidatePlanAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Validate Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ValidatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1ValidatePlanResponseContent( securityRequirements: s_V1ValidatePlanSecurityRequirements, operationName: "V1ValidatePlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/validate_plan", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/validate_plan", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1ValidatePlanResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ValidatePlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ValidatePlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ValidatePlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ValidatePlanResponseContent( + response: __response); + ProcessV1ValidatePlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ValidationResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ValidationResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ValidatePlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ValidationResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.ValidationResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Validate Plan @@ -253,12 +483,14 @@ partial void ProcessV1ValidatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreatePlanPayload @@ -270,6 +502,7 @@ partial void ProcessV1ValidatePlanResponseContent( return await V1ValidatePlanAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs deleted file mode 100644 index 7049a351..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirement0, - }; - partial void PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Action Items Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirements, - operationName: "VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/action-items", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs deleted file mode 100644 index a723f3a0..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirement0, - }; - partial void PrepareVidaaActionItemsSolutionsVidaaActionItemsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaActionItemsSolutionsVidaaActionItemsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Action Items - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaActionItemsSolutionsVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaActionItemsSolutionsVidaaActionItemsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirements, - operationName: "VidaaActionItemsSolutionsVidaaActionItemsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/action-items", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaActionItemsSolutionsVidaaActionItemsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs deleted file mode 100644 index 15212b15..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirement0, - }; - partial void PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Feed Items Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirements, - operationName: "VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/feed-items", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs deleted file mode 100644 index 55c3b7ef..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirement0, - }; - partial void PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Feed Items - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirements, - operationName: "VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/feed-items", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs deleted file mode 100644 index 1771d614..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirement0, - }; - partial void PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Messages Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirements, - operationName: "VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/api/messages", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs deleted file mode 100644 index 60752b5d..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirement0, - }; - partial void PrepareVidaaMessagesSolutionsVidaaApiMessagesPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaMessagesSolutionsVidaaApiMessagesPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Messages - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaMessagesSolutionsVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaMessagesSolutionsVidaaApiMessagesPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirements, - operationName: "VidaaMessagesSolutionsVidaaApiMessagesPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/api/messages", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaMessagesSolutionsVidaaApiMessagesPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 7f7cec77..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirement0, - }; - partial void PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Scheduler Stats Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirements, - operationName: "VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/scheduler-stats", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 8b55bdf8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirement0, - }; - partial void PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Scheduler Stats - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirements, - operationName: "VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/scheduler-stats", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs deleted file mode 100644 index f67ec947..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirement0, - }; - partial void PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Sources Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirements, - operationName: "VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/sources", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs deleted file mode 100644 index 18184c2a..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirement0, - }; - partial void PrepareVidaaSourcesSolutionsVidaaSourcesGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSourcesSolutionsVidaaSourcesGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSourcesSolutionsVidaaSourcesGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSourcesSolutionsVidaaSourcesGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Sources - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSourcesSolutionsVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSourcesSolutionsVidaaSourcesGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirements, - operationName: "VidaaSourcesSolutionsVidaaSourcesGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/sources", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSourcesSolutionsVidaaSourcesGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSourcesSolutionsVidaaSourcesGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSourcesSolutionsVidaaSourcesGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs deleted file mode 100644 index df9ccbc9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscribe Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirements, - operationName: "VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/subscribe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs deleted file mode 100644 index 029afee1..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaSubscribeSolutionsVidaaSubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscribeSolutionsVidaaSubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscribe - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscribeSolutionsVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscribeSolutionsVidaaSubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirements, - operationName: "VidaaSubscribeSolutionsVidaaSubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/subscribe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSubscribeSolutionsVidaaSubscribePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs deleted file mode 100644 index 2f7b2213..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirement0, - }; - partial void PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscriptions Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirements, - operationName: "VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/subscriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs deleted file mode 100644 index da69ec9b..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirement0, - }; - partial void PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirements, - operationName: "VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/subscriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs deleted file mode 100644 index 48c82fce..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirement0, - }; - partial void PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Summarize Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirements, - operationName: "VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/summarize", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs deleted file mode 100644 index b438aab7..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirement0, - }; - partial void PrepareVidaaSummarizeSolutionsVidaaSummarizePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSummarizeSolutionsVidaaSummarizePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Summarize - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSummarizeSolutionsVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSummarizeSolutionsVidaaSummarizePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirements, - operationName: "VidaaSummarizeSolutionsVidaaSummarizePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/summarize", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSummarizeSolutionsVidaaSummarizePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs deleted file mode 100644 index 46830b63..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirement0, - }; - partial void PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Trigger Poll Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirements, - operationName: "VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/trigger-poll", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs deleted file mode 100644 index d5530a31..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirement0, - }; - partial void PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Trigger Poll - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirements, - operationName: "VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/trigger-poll", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs deleted file mode 100644 index 36570ebb..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Unsubscribe Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirements, - operationName: "VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/unsubscribe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs deleted file mode 100644 index dca5c131..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Unsubscribe - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirements, - operationName: "VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/unsubscribe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs deleted file mode 100644 index 9ff63eb2..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirement0, - }; - partial void PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Feedback Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirements, - operationName: "WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/wpp/feedback", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs deleted file mode 100644 index cb9b5c89..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirement0, - }; - partial void PrepareWppFeedbackSolutionsWppFeedbackPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppFeedbackSolutionsWppFeedbackPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppFeedbackSolutionsWppFeedbackPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppFeedbackSolutionsWppFeedbackPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Feedback - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppFeedbackSolutionsWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppFeedbackSolutionsWppFeedbackPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirements, - operationName: "WppFeedbackSolutionsWppFeedbackPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/wpp/feedback", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppFeedbackSolutionsWppFeedbackPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessWppFeedbackSolutionsWppFeedbackPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessWppFeedbackSolutionsWppFeedbackPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs deleted file mode 100644 index c2c92951..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirement0, - }; - partial void PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Query Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppQueryPrefixPreviewSolutionsPreviewWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirements, - operationName: "WppQueryPrefixPreviewSolutionsPreviewWppQueryPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/wpp/query", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.WppQuerySolutionsWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppQuerySolutionsWppQueryPost.g.cs deleted file mode 100644 index 4fdd5c9a..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppQuerySolutionsWppQueryPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppQuerySolutionsWppQueryPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppQuerySolutionsWppQueryPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppQuerySolutionsWppQueryPostSecurityRequirement0, - }; - partial void PrepareWppQuerySolutionsWppQueryPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppQuerySolutionsWppQueryPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppQuerySolutionsWppQueryPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppQuerySolutionsWppQueryPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Query - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppQuerySolutionsWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppQuerySolutionsWppQueryPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppQuerySolutionsWppQueryPostSecurityRequirements, - operationName: "WppQuerySolutionsWppQueryPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/wpp/query", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppQuerySolutionsWppQueryPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessWppQuerySolutionsWppQueryPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessWppQuerySolutionsWppQueryPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::AI21.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), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.g.cs index ec021f0f..4b478987 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.g.cs @@ -31,6 +31,9 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -40,7 +43,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public JambaCompleteClient JambaComplete => new JambaCompleteClient(HttpClient, authorizations: Authorizations) + public JambaCompleteClient JambaComplete => new JambaCompleteClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -49,7 +52,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public LibraryManagementClient LibraryManagement => new LibraryManagementClient(HttpClient, authorizations: Authorizations) + public LibraryManagementClient LibraryManagement => new LibraryManagementClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -58,7 +61,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public RagEngineClient RagEngine => new RagEngineClient(HttpClient, authorizations: Authorizations) + public RagEngineClient RagEngine => new RagEngineClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -67,7 +70,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public SecretsClient Secrets => new SecretsClient(HttpClient, authorizations: Authorizations) + public SecretsClient Secrets => new SecretsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -76,7 +79,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public WebsiteConnectorClient WebsiteConnector => new WebsiteConnectorClient(HttpClient, authorizations: Authorizations) + public WebsiteConnectorClient WebsiteConnector => new WebsiteConnectorClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -95,11 +98,58 @@ public Ai21Client( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the Ai21Client with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public Ai21Client( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the Ai21Client. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public Ai21Client( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, bool disposeHttpClient = true) { + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs b/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs index 7fa57a7d..efdc8e91 100644 --- a/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs +++ b/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs @@ -25,6 +25,26 @@ namespace AI21 #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -41,6 +61,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); /// /// /// @@ -59,6 +99,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -77,6 +122,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -143,6 +193,30 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs b/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs index 7b32c0fa..e225d3be 100644 --- a/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs +++ b/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs @@ -25,6 +25,26 @@ namespace AI21 #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -42,6 +62,26 @@ namespace AI21 #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -59,6 +99,26 @@ namespace AI21 #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// /// /// @@ -75,6 +135,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] #endif public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); /// /// /// @@ -93,6 +173,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -111,6 +196,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -129,6 +219,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -147,6 +242,11 @@ public AnyOf(T4? value) Value4 = value; } + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + /// /// /// @@ -231,6 +331,42 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/AI21/Generated/AI21.AutoSDKHttpResponse.g.cs b/src/libs/AI21/Generated/AI21.AutoSDKHttpResponse.g.cs new file mode 100644 index 00000000..57eb4e71 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Exceptions.g.cs b/src/libs/AI21/Generated/AI21.Exceptions.g.cs index c7e2755a..a1ba2e0c 100644 --- a/src/libs/AI21/Generated/AI21.Exceptions.g.cs +++ b/src/libs/AI21/Generated/AI21.Exceptions.g.cs @@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception /// The HTTP status code of the response. /// public global::System.Net.HttpStatusCode StatusCode { get; } + /// /// The response body as a string, or null if the body could not be read. /// This is always populated for error responses regardless of the ReadResponseAsString setting. /// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read. /// public string? ResponseBody { get; set; } + /// /// The response headers. /// public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// /// Initializes a new instance of the class. /// @@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl { StatusCode = statusCode; } + + /// + /// Constructs an instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain when the hierarchy is disabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static global::AI21.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::AI21.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::AI21.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::AI21.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseHeaders = responseHeaders; + return exception; + } + + /// + /// Parses a Retry-After response header (delta-seconds or HTTP-date) into a . + /// Returns null when the header is missing or unparseable. Public so consumer code that observes + /// directly can recover the value without re-implementing the parser. + /// + public static global::System.TimeSpan? TryParseRetryAfter( + global::System.Collections.Generic.IDictionary>? headers) + { + if (headers == null) + { + return null; + } + + global::System.Collections.Generic.IEnumerable? values = null; + foreach (var entry in headers) + { + if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase)) + { + values = entry.Value; + break; + } + } + + if (values == null) + { + return null; + } + + string? raw = null; + foreach (var value in values) + { + if (!string.IsNullOrWhiteSpace(value)) + { + raw = value.Trim(); + break; + } + } + + if (string.IsNullOrEmpty(raw)) + { + return null; + } + + if (int.TryParse( + raw, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var seconds) && seconds >= 0) + { + return global::System.TimeSpan.FromSeconds(seconds); + } + + if (global::System.DateTimeOffset.TryParse( + raw, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var when)) + { + var delta = when - global::System.DateTimeOffset.UtcNow; + return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero; + } + + return null; + } } /// @@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } + + /// + /// Constructs an whose runtime type matches the response status code when the typed exception hierarchy is enabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static new global::AI21.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::AI21.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::AI21.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + T? responseObject, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::AI21.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseObject = responseObject; + exception.ResponseHeaders = responseHeaders; + return exception; + } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs index 50652c2b..bbd55e4c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Can Iframe /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CanIframeStudioV1DemosScraperCanIframeGetAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Can Iframe + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CanIframeStudioV1DemosScraperCanIframeGetAsResponseAsync( + string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs deleted file mode 100644 index 975cbeb0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Claroty Product Lookup - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ClarotyProductLookupSolutionsClarotyProductLookupPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs deleted file mode 100644 index 7a009de4..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Claroty Scrape Url - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs deleted file mode 100644 index b99eab2c..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Claroty Suggest Vendor Model - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs index ff47f20c..830229b4 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Compare text in a document file against a reference text. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Compare Text
+ /// Compare text in a document file against a reference text. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CompareTextStudioV1DemosDocumentModifierCompareTextPostAsResponseAsync( + + global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Compare Text
@@ -21,11 +36,13 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( string originalText, string modifiedText, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 37351a7d..35d0e57d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -8,20 +8,71 @@ public partial interface IAi21Client /// Convert Document File /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Convert Document File + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + + global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Convert Document File /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::System.Collections.Generic.IList files, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Convert Document File + /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Convert Document File + /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs index ad0682af..1e5ef3af 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Create a new demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Demo
+ /// Create a new demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDemoStudioV1DemosPostAsResponseAsync( + + global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Demo
@@ -34,6 +49,7 @@ public partial interface IAi21Client /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( @@ -42,6 +58,7 @@ public partial interface IAi21Client global::AI21.DemoStatus status, string uiComponentName, object? config = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs index 4e8cbe93..4a4bb883 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Create Mcp Storage ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateMcpStorageStudioV1McpStoragePostAsResponseAsync( + + global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Mcp Storage @@ -26,6 +40,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( @@ -36,6 +51,7 @@ public partial interface IAi21Client string? authHeaderName = default, string? authValue = default, global::System.Collections.Generic.IList? allowedTools = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs index 3bb1ef61..f2bc8256 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( string organizationId, global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Organization Schema + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsResponseAsync( + string organizationId, + + global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Organization Schema @@ -25,6 +41,7 @@ public partial interface IAi21Client /// /// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( @@ -32,6 +49,7 @@ public partial interface IAi21Client string schemaName, object schemaObject, bool? runClassification = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs index 8cf8d99e..7232ab38 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Delete a demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteDemoStudioV1DemosDemoIdDeleteAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Demo
+ /// Delete a demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteDemoStudioV1DemosDemoIdDeleteAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs index 0525d836..9c872dd7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Delete Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs index 06e10d84..ee80b7ff 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync( string organizationId, string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Organization Schema + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsResponseAsync( + string organizationId, + string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs index 8bee4408..ee6bd9c2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Delete Website Connector /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync( string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Website Connector + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsResponseAsync( + string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs index d6739e97..a95855e7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Delete Workspace Model Endpoint /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync( string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Workspace Model Endpoint + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsResponseAsync( + string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs index af7a764c..daf698cd 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detect Schema + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsResponseAsync( + string organizationId, + + global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Detect Schema @@ -22,12 +38,14 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::System.Collections.Generic.IList documents, global::System.Collections.Generic.IList? queries = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs index ec056a93..c54a5aa8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Download a modified document. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Modified Document
+ /// Download a modified document. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsResponseAsync( + + global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Download Modified Document
@@ -21,11 +36,13 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( string content, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index 5f04022d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index 4bc21ddc..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index f86b0e94..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index 536d7e54..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict Status - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 1c74289d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index 23b18f54..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index cd7e80e2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Results - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 7b9f6ce2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index acdafbea..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index a12a801f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Status - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index 531fddac..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 86d04b82..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 0db37f9e..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Results - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index 5d44832d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index e7d370d1..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index 45a2c87f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Status - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs deleted file mode 100644 index c272a2e6..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs deleted file mode 100644 index 946994c3..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Classifications - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index 3e822f5d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index 639b822d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Classifications - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 2a8f991e..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 42595781..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Descriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs deleted file mode 100644 index 11342276..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs deleted file mode 100644 index b7b9ea4f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Descriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs index e0869120..2194e2f8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Forward Paragon Webhook /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Forward Paragon Webhook + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs index 835cc765..124e1e6a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Generate Org Token /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync( string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Org Token + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsResponseAsync( + string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs index d56c4b50..b7b25a1f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Combine section answers ➜ styled PDF for download /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Combine section answers ➜ styled PDF for download + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsResponseAsync( + + global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Combine section answers ➜ styled PDF for download @@ -20,10 +34,12 @@ public partial interface IAi21Client /// /// All section answers concatenated /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( string text, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs index cdd8d803..954f9fce 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Assistants By Mcp /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Assistants By Mcp + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs index 8ce5781f..1b5513e2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Get Available Models Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Available Models Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs index 4f5c7c33..5136ffca 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs @@ -10,12 +10,29 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync( string entityId, string dataSource, string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Connector Connection Status + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsResponseAsync( + string entityId, + string dataSource, + string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs index d44822d5..902bb3fb 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs @@ -10,12 +10,29 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync( string entityId, string dataSource, string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Data Source Status + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsResponseAsync( + string entityId, + string dataSource, + string paragonToken, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs index ae0d862f..c71b54a9 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Get a specific demo by ID. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetDemoStudioV1DemosDemoIdGetAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Demo
+ /// Get a specific demo by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDemoStudioV1DemosDemoIdGetAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs index 646df227..23f84f2c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync( string fileId, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get File Url + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsResponseAsync( + string fileId, + string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs index d3a4aa66..bc3d2a90 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetMcpStorageStudioV1McpStorageMcpIdGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetMcpStorageStudioV1McpStorageMcpIdGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs index 9dfb67b2..fe842e27 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Org Data Sources Info /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync( string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Org Data Sources Info + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsResponseAsync( + string entityId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs index bc4f583d..fc479244 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Organization Schemas /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync( string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Organization Schemas + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsResponseAsync( + string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs index c7b56ec9..09b02448 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs @@ -13,11 +13,30 @@ public partial interface IAi21Client /// /// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync( string executionId, bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Output Explanation
+ /// Get output explanation for an execution (cached or generated).
+ /// Set force_regenerate=True to regenerate even if cached. + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsResponseAsync( + string executionId, + bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs index 37acbd30..412ac982 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Get the parsed file from the document modifier. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync( string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Parsed File
+ /// Get the parsed file from the document modifier. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsResponseAsync( + string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs index f52036da..df849873 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs @@ -13,11 +13,30 @@ public partial interface IAi21Client /// /// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync( string executionId, bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Step Explanations
+ /// Get step explanations for an execution (cached or generated).
+ /// Set force_regenerate=True to regenerate even if cached. + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsResponseAsync( + string executionId, + bool? forceRegenerate = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs index 0e336147..4d527b46 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Get a vector store by ID. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync( string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Vector Store
+ /// Get a vector store by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsResponseAsync( + string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs index 54aca650..b21803e1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Website Connector By Id /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync( string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Website Connector By Id + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsResponseAsync( + string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs index 62bee7f5..90d48482 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Get Website Connector /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Website Connector + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs index cfd7d425..d13bca1f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Workspace Model Secret Endpoint /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync( string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workspace Model Secret Endpoint + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsResponseAsync( + string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs index 35524629..a0a4a026 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Get Workspace Models By Organization Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workspace Models By Organization Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs index 803212b8..339eb2cf 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Execute a Jamba request. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Jamba Execute
+ /// Execute a Jamba request. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsResponseAsync( + + global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Jamba Execute
@@ -23,6 +38,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( @@ -30,6 +46,7 @@ public partial interface IAi21Client string task, string prompt, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index c5f7346d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Document Upload Process Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index 394244e0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Document Upload Process - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs deleted file mode 100644 index 6e516348..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Email Assistant Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs deleted file mode 100644 index 5c144142..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Email Assistant - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index 90e56218..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Funding And Categorization Check Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index fe3ab6fe..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Funding And Categorization Check - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs deleted file mode 100644 index c3f430ab..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Compliance Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs deleted file mode 100644 index 1dab2ebd..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Compliance - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs deleted file mode 100644 index a2790cbd..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Metadata Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs deleted file mode 100644 index 6557e8e7..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Metadata - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs new file mode 100644 index 00000000..c94ab1e8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Public Information Check Job Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Public Information Check Job Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs new file mode 100644 index 00000000..d83b73fb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Public Information Check Job + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Public Information Check Job + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs new file mode 100644 index 00000000..50a2547b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Public Information Check Jobs Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Public Information Check Jobs Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs new file mode 100644 index 00000000..87fa1d04 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Public Information Check Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Public Information Check Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 8fa0e0a5..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Public Information Check Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 147906d2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Public Information Check - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs index 3e0c9c22..f6a7f8c1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs @@ -8,9 +8,21 @@ public partial interface IAi21Client /// List Demos
/// List all available demos. ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ListDemosStudioV1DemosGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Demos
+ /// List all available demos. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListDemosStudioV1DemosGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs index 95b53926..800b4120 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// List Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ListMcpStorageStudioV1McpStorageGetAsync( global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListMcpStorageStudioV1McpStorageGetAsResponseAsync( + global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs index 3ee3cc70..018a8fb8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Mcp Tool Discovery /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( global::AI21.MCPDefinition request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Mcp Tool Discovery + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> McpToolDiscoveryStudioV1McpDiscoverPostAsResponseAsync( + + global::AI21.MCPDefinition request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Mcp Tool Discovery @@ -20,12 +34,14 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( string serverUrl, string? serverLabel = default, object? headers = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs index c064a385..34ac3bc2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Parse a PDF file and return its contents. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + + global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Parse Pdf
@@ -21,11 +36,46 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( byte[] file, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + global::System.IO.Stream file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs index 8c31ea67..689de667 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs @@ -8,22 +8,38 @@ public partial interface IAi21Client /// Post Website Connector /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( global::AI21.WebsiteConnectorPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Post Website Connector + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsResponseAsync( + + global::AI21.WebsiteConnectorPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Post Website Connector /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( global::AI21.WebsiteConnectorPayloadType type, global::AI21.AnyOf> value, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs index 98d4b17b..b4ad5b6f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Process Rfi Document /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Process Rfi Document + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + + global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Process Rfi Document @@ -30,6 +44,7 @@ public partial interface IAi21Client /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( @@ -37,6 +52,60 @@ public partial interface IAi21Client string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs index f886d061..e6cf2736 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Run Sync ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( global::AI21.ConnectorsSyncParams request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Sync + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsResponseAsync( + + global::AI21.ConnectorsSyncParams request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Run Sync @@ -23,6 +37,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( @@ -32,6 +47,7 @@ public partial interface IAi21Client string pipeline, object? configuration = default, string? configurationName = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs index 69e30331..cdaf92bf 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs @@ -10,12 +10,29 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync( string entityId, string dataSource, string workflowName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Workflow + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsResponseAsync( + string entityId, + string dataSource, + string workflowName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs index d59c9e76..4b18854e 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Sync Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync( string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Sync Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsResponseAsync( + string connectorId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index 82a9ca18..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Tlv Convrag Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index 6ce2a45f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Tlv Convrag - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TlvConvragSolutionsTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs index 5cdafc7a..97f54409 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs @@ -10,12 +10,29 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( string demoId, global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Demo
+ /// Update an existing demo. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateDemoStudioV1DemosDemoIdPutAsResponseAsync( + string demoId, + + global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Demo
@@ -37,6 +54,7 @@ public partial interface IAi21Client /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( @@ -46,6 +64,7 @@ public partial interface IAi21Client global::AI21.DemoStatus? status = default, object? config = default, string? uiComponentName = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs index e1c862ee..18196fee 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs @@ -9,23 +9,41 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Mcp Storage + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsResponseAsync( + string mcpId, + + global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Mcp Storage /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, string serverLabel, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs index 3aafdbe1..de563ee7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( string name, global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Workspace Model Endpoint + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsResponseAsync( + string name, + + global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Workspace Model Endpoint @@ -23,6 +39,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( @@ -30,6 +47,7 @@ public partial interface IAi21Client string? requestName = default, string? modelType = default, string? secretId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs index bd140f32..a247f580 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Check compliance of a document file against regulatory requirements. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + + global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Upload Check Compliance
@@ -27,6 +42,7 @@ public partial interface IAi21Client /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( @@ -34,6 +50,56 @@ public partial interface IAi21Client string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs index ae45b8a1..3f61194c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Create Assistant ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateAssistantAsync( global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1CreateAssistantAsResponseAsync( + + global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Assistant @@ -34,6 +48,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateAssistantAsync( @@ -50,6 +65,7 @@ public partial interface IAi21Client string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs index 29f61af5..a491eb74 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1CreatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Plan @@ -22,12 +38,14 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs index fa64991b..fcc276eb 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateRouteAsync( string assistantId, global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1CreateRouteAsResponseAsync( + string assistantId, + + global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Route @@ -24,6 +40,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateRouteAsync( @@ -32,6 +49,7 @@ public partial interface IAi21Client string name, string description, global::System.Collections.Generic.IList examples, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs index 5d789ab5..ff1b3df0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Delete Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1DeleteAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1DeleteAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs index 49bc6fee..38c87bc1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1DeleteRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1DeleteRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs index 4b67e94f..0570ed4f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs @@ -8,22 +8,38 @@ public partial interface IAi21Client /// Generate Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GenerateAssistantAsync( global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GenerateAssistantAsResponseAsync( + + global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Generate Assistant /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GenerateAssistantAsync( string prompt, string? avatar = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs index de766947..646e917a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs index 6a260913..d5c18902 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetMaestroRunAsync( string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetMaestroRunAsResponseAsync( + string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs index 46c8653e..123ab059 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetPlanAsync( string planId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetPlanAsResponseAsync( + string planId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs index a5cffa7c..bee097a5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs index f10c0dab..e826a396 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Assistants /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ListAssistantsAsync( global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Assistants + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ListAssistantsAsResponseAsync( + global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs index d7c3053a..4699b255 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Get Models Info /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ListModelsInfoAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Models Info + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ListModelsInfoAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs index 8ce894db..3b069fc3 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// List Plans /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ListPlansAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Plans + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ListPlansAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs index eb2ad2ad..7a895697 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ListRoutesAsync( string assistantId, string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Routes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ListRoutesAsResponseAsync( + string assistantId, + string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs index fff0103a..22b1471f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Create Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1MaestroRunAsync( global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1MaestroRunAsResponseAsync( + + global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Maestro Run @@ -51,6 +65,7 @@ public partial interface IAi21Client /// be 1. A streaming response is different than the non-streaming response.
/// Default Value: false /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1MaestroRunAsync( @@ -71,6 +86,7 @@ public partial interface IAi21Client global::AI21.CreateMaestroRunsPayloadResponseLanguage? responseLanguage = default, string? systemPrompt = default, bool? stream = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs index e2ad85a4..9f3f9b90 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyAssistantAsync( string assistantId, global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ModifyAssistantAsResponseAsync( + string assistantId, + + global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Assistant @@ -42,6 +58,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyAssistantAsync( @@ -60,6 +77,7 @@ public partial interface IAi21Client string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs index d0991f91..13cba1d7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs @@ -10,6 +10,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -17,6 +18,23 @@ public partial interface IAi21Client string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Plan + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ModifyPlanAsResponseAsync( + string planId, + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Plan @@ -25,6 +43,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -32,6 +51,7 @@ public partial interface IAi21Client string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs index 336912ec..fd54930b 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs @@ -10,6 +10,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -17,6 +18,23 @@ public partial interface IAi21Client string assistantId, global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Route + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ModifyRouteAsResponseAsync( + string routeId, + string assistantId, + + global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Route @@ -25,6 +43,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -32,6 +51,7 @@ public partial interface IAi21Client string assistantId, string description, global::System.Collections.Generic.IList? examples = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs index 13a53dcf..2374b8ed 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1RunAssistantAsync( string assistantId, global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1RunAssistantAsResponseAsync( + string assistantId, + + global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Run Assistant @@ -38,6 +54,7 @@ public partial interface IAi21Client /// Default Value: unset /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1RunAssistantAsync( @@ -50,6 +67,7 @@ public partial interface IAi21Client bool? dynamicPlanningEnabled = default, global::AI21.RunAssistantRequestResponseLanguage? responseLanguage = default, string? systemPrompt = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotyProductLookup.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotyProductLookup.g.cs new file mode 100644 index 00000000..3d52cd28 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotyProductLookup.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Claroty Product Lookup + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsClarotyProductLookupAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Claroty Product Lookup + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsClarotyProductLookupAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotySuggestVendorModel.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotySuggestVendorModel.g.cs new file mode 100644 index 00000000..2f564b09 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotySuggestVendorModel.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Claroty Suggest Vendor Model + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsClarotySuggestVendorModelAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Claroty Suggest Vendor Model + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsClarotySuggestVendorModelAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs new file mode 100644 index 00000000..f7fe9275 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..20969497 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..b6900208 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..c59b0075 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..d548303e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..8bf6e04f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs new file mode 100644 index 00000000..2f18bfe7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..0151b139 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..2d06022a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..14ed1aad --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..6e25a614 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..67cb3a3c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs new file mode 100644 index 00000000..578ae4c0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs new file mode 100644 index 00000000..f9ef48fd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs new file mode 100644 index 00000000..fc9d210f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs new file mode 100644 index 00000000..fc894c3a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs new file mode 100644 index 00000000..7b4127b3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..2542f9e2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..3efd9616 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs new file mode 100644 index 00000000..f0b2e140 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs new file mode 100644 index 00000000..6d8d6e2c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..e773a2ae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..cf7d8bac --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs new file mode 100644 index 00000000..40aeb9d1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshDocumentUploadProcess.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshDocumentUploadProcess.g.cs new file mode 100644 index 00000000..b69fd304 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshDocumentUploadProcess.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Document Upload Process + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshDocumentUploadProcessAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Document Upload Process + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshDocumentUploadProcessAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshEmailAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshEmailAssistant.g.cs new file mode 100644 index 00000000..2afd3f93 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshEmailAssistant.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Email Assistant + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshEmailAssistantAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Email Assistant + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshEmailAssistantAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs new file mode 100644 index 00000000..8af9c412 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Funding And Categorization Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshFundingAndCategorizationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Funding And Categorization Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshFundingAndCategorizationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantCompliance.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantCompliance.g.cs new file mode 100644 index 00000000..de2bd968 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantCompliance.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Grant Compliance + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshGrantComplianceAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Grant Compliance + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshGrantComplianceAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantMetadata.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantMetadata.g.cs new file mode 100644 index 00000000..d471af46 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantMetadata.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Grant Metadata + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshGrantMetadataAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Grant Metadata + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshGrantMetadataAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs new file mode 100644 index 00000000..507bfb64 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Document Upload Process Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewDocumentUploadProcessAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Document Upload Process Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewDocumentUploadProcessAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs new file mode 100644 index 00000000..82d1f9a4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Email Assistant Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewEmailAssistantAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Email Assistant Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewEmailAssistantAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs new file mode 100644 index 00000000..3fe6e02d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Funding And Categorization Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Funding And Categorization Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewFundingAndCategorizationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs new file mode 100644 index 00000000..53951cb3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Grant Compliance Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewGrantComplianceAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Grant Compliance Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewGrantComplianceAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs new file mode 100644 index 00000000..8bb7c4f9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Grant Metadata Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewGrantMetadataAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Grant Metadata Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewGrantMetadataAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs new file mode 100644 index 00000000..0c902e0c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Public Information Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewPublicInformationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Public Information Check Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshPreviewPublicInformationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPublicInformationCheck.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPublicInformationCheck.g.cs new file mode 100644 index 00000000..67f4b998 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPublicInformationCheck.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Kirsh Public Information Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsKirshPublicInformationCheckAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Kirsh Public Information Check + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsKirshPublicInformationCheckAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs new file mode 100644 index 00000000..3e5fce5c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs new file mode 100644 index 00000000..144f3d5d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityPreviewConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityPreviewConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaActionItems.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaActionItems.g.cs new file mode 100644 index 00000000..d986320e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaActionItems.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Action Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaActionItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Action Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaActionItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaApiMessages.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaApiMessages.g.cs new file mode 100644 index 00000000..c406b410 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaApiMessages.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentApiMessages.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentApiMessages.g.cs new file mode 100644 index 00000000..34249dfd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentApiMessages.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Messages + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBrief.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBrief.g.cs new file mode 100644 index 00000000..3b60e658 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBrief.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobs.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobs.g.cs new file mode 100644 index 00000000..b67609fc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobs.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefJobsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief Jobs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefJobsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs new file mode 100644 index 00000000..9fc37f64 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief Jobs Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefJobsStatusAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief Jobs Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefJobsStatusAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefScheduled.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefScheduled.g.cs new file mode 100644 index 00000000..49c87f6c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefScheduled.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief Scheduled + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefScheduledAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief Scheduled + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentBriefScheduledAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscribe.g.cs new file mode 100644 index 00000000..2715b6bf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscriptions.g.cs new file mode 100644 index 00000000..682cba72 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentUnsubscribe.g.cs new file mode 100644 index 00000000..16049f7d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentUnsubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaContentUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaContentUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaFeedItems.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaFeedItems.g.cs new file mode 100644 index 00000000..7fb8173b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaFeedItems.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Feed Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaFeedItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Feed Items + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaFeedItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewActionItems.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewActionItems.g.cs new file mode 100644 index 00000000..931775e5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewActionItems.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Action Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewActionItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Action Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewActionItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewApiMessages.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewApiMessages.g.cs new file mode 100644 index 00000000..5922c1e2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewApiMessages.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs new file mode 100644 index 00000000..0906150d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentApiMessagesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Messages Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentApiMessagesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBrief.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBrief.g.cs new file mode 100644 index 00000000..897d2bf0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBrief.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs new file mode 100644 index 00000000..0d9de0da --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief Jobs Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefJobsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief Jobs Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefJobsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs new file mode 100644 index 00000000..a019468f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief Jobs Status Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefJobsStatusAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief Jobs Status Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefJobsStatusAsResponseAsync( + string jobId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs new file mode 100644 index 00000000..6b365e50 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Brief Scheduled Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentBriefScheduledAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Brief Scheduled Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentBriefScheduledAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs new file mode 100644 index 00000000..a0ff78f0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs new file mode 100644 index 00000000..6fc29d22 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs new file mode 100644 index 00000000..082d6fe3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Content Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewContentUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Content Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewContentUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewFeedItems.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewFeedItems.g.cs new file mode 100644 index 00000000..fb5eb53c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewFeedItems.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Feed Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewFeedItemsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Feed Items Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewFeedItemsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs new file mode 100644 index 00000000..b3a8b0a2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Scheduler Stats Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSchedulerStatsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Scheduler Stats Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSchedulerStatsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSources.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSources.g.cs new file mode 100644 index 00000000..8d631356 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSources.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Sources Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSourcesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Sources Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSourcesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscribe.g.cs new file mode 100644 index 00000000..ac6fe80d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Subscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs new file mode 100644 index 00000000..88b692b4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Subscriptions Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSummarize.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSummarize.g.cs new file mode 100644 index 00000000..064604bb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSummarize.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Summarize Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSummarizeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Summarize Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewSummarizeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs new file mode 100644 index 00000000..9ba241fc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Trigger Poll Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewTriggerPollAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Trigger Poll Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewTriggerPollAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs new file mode 100644 index 00000000..9957f4fa --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Unsubscribe Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaPreviewUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSchedulerStats.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSchedulerStats.g.cs new file mode 100644 index 00000000..c196365d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSchedulerStats.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Scheduler Stats + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaSchedulerStatsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Scheduler Stats + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaSchedulerStatsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSources.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSources.g.cs new file mode 100644 index 00000000..ada516b8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSources.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Sources + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaSourcesAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Sources + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaSourcesAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscribe.g.cs new file mode 100644 index 00000000..5f379ab8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaSubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Subscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaSubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscriptions.g.cs new file mode 100644 index 00000000..1277e501 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaSubscriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Subscriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaSubscriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSummarize.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSummarize.g.cs new file mode 100644 index 00000000..c8a5fbae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSummarize.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Summarize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaSummarizeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Summarize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaSummarizeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaTriggerPoll.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaTriggerPoll.g.cs new file mode 100644 index 00000000..01cf91be --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaTriggerPoll.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Trigger Poll + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaTriggerPollAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Trigger Poll + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaTriggerPollAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaUnsubscribe.g.cs new file mode 100644 index 00000000..9a2dd1cd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaUnsubscribe.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Vidaa Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsVidaaUnsubscribeAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Vidaa Unsubscribe + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsVidaaUnsubscribeAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs index 6d543240..e4bbabf5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs @@ -8,20 +8,36 @@ public partial interface IAi21Client /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Requirements + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1StudioApiGenerationRequirementsAsResponseAsync( + + global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( string query, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs index 230a9922..ef9d59d8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs @@ -8,20 +8,36 @@ public partial interface IAi21Client /// Generate Thread Name /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( global::AI21.ThreadNameGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Thread Name + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1StudioApiGenerationThreadNameAsResponseAsync( + + global::AI21.ThreadNameGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Generate Thread Name /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( string query, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs index b92773ca..4dbd9429 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Validate Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ValidatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Validate Plan @@ -22,12 +38,14 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs deleted file mode 100644 index af6c2bd5..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Action Items Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs deleted file mode 100644 index 7001790e..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Action Items - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaActionItemsSolutionsVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs deleted file mode 100644 index 11c3c89b..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Feed Items Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs deleted file mode 100644 index ef82e444..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Feed Items - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs deleted file mode 100644 index 000866dc..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Messages Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs deleted file mode 100644 index eba58d33..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Messages - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaMessagesSolutionsVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 4ce6d5ce..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Scheduler Stats Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 6e8265b0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Scheduler Stats - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs deleted file mode 100644 index 1fe458a2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Sources Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs deleted file mode 100644 index cbfc2328..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Sources - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSourcesSolutionsVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs deleted file mode 100644 index 2f6b614a..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscribe Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs deleted file mode 100644 index e7b03f17..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscribe - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscribeSolutionsVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs deleted file mode 100644 index eca05fea..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscriptions Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs deleted file mode 100644 index b15401d6..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs deleted file mode 100644 index c9ae60f9..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Summarize Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs deleted file mode 100644 index 71909ad7..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Summarize - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSummarizeSolutionsVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs deleted file mode 100644 index 07921c42..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Trigger Poll Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs deleted file mode 100644 index 393e0fa0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Trigger Poll - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs deleted file mode 100644 index 8a63bb2c..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Unsubscribe Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs deleted file mode 100644 index f51de598..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Unsubscribe - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs deleted file mode 100644 index cddada7b..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Feedback Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs deleted file mode 100644 index 3df5db88..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Feedback - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppFeedbackSolutionsWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs deleted file mode 100644 index c79d4125..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Query Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppQueryPrefixPreviewSolutionsPreviewWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppQuerySolutionsWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppQuerySolutionsWppQueryPost.g.cs deleted file mode 100644 index 4f400fb3..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppQuerySolutionsWppQueryPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Query - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppQuerySolutionsWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.g.cs index 8ca6623f..71464623 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.g.cs @@ -33,6 +33,11 @@ public partial interface IAi21Client : global::System.IDisposable /// ensuring is populated. /// public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs index c02f2719..e5b937b6 100644 --- a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs @@ -13,11 +13,30 @@ public partial interface IJambaCompleteClient /// token is generated, rather than waiting for the entire response. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Studio Chat Complete
+ /// This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).
+ /// This is a foundation model that supports both single-turn (question answering,
+ /// text completion) and multi-turn (chat style) interactions.
+ /// You can optionally stream results if you want to get the response as each
+ /// token is generated, rather than waiting for the entire response. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>>> V1ChatCompleteAsResponseAsync( + + global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Studio Chat Complete
@@ -86,6 +105,7 @@ public partial interface IJambaCompleteClient /// /// Default Value: {"type":"text"} /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( @@ -101,6 +121,7 @@ public partial interface IJambaCompleteClient global::AI21.MockResponseConfig? mockResponse = default, global::System.Collections.Generic.IList? documents = default, global::AI21.ResponseFormat? responseFormat = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs index 73d1a55e..bda028ae 100644 --- a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs @@ -32,6 +32,11 @@ public partial interface IJambaCompleteClient : global::System.IDisposable /// ensuring is populated. ///
public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs index f701b9e9..be0808b1 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs @@ -11,10 +11,26 @@ public partial interface ILibraryManagementClient /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryDeleteAsync( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete File
+ /// Delete the specified file from the library.
+ /// **Restrictions**:
+ /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryDeleteAsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs index e2a783a2..0b7f3eda 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs @@ -19,6 +19,7 @@ public partial interface ILibraryManagementClient /// Default Value: 500000 /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> V1LibraryManagementAsync( @@ -28,6 +29,34 @@ public partial interface ILibraryManagementClient global::System.Collections.Generic.IList? label = default, int? limit = default, int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workspace Files
+ /// Get metadata about a specific file by file ID. The file ID is generated by
+ /// AI21 when you upload the file. + ///
+ /// + /// + /// + /// An enumeration. + /// + /// + /// + /// Default Value: 500000 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> V1LibraryManagementAsResponseAsync( + string? name = default, + string? path = default, + global::AI21.FileStatus? status = default, + global::System.Collections.Generic.IList? label = default, + int? limit = default, + int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs index 30757fea..443fd8e2 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs @@ -16,10 +16,31 @@ public partial interface ILibraryManagementClient /// "financial" AND status UPLOADED will be returned. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get File By Id
+ /// Retrieve a list of documents in the user's library. Optionally specify a
+ /// filter to find only files with matching labels or paths. This method
+ /// returns only metadata about files; to download a file, call
+ /// `GET .../files/{file_id}/download`
+ /// When specifying qualifiers with your request, only files that match
+ /// _all_ qualifiers will be returns. So, for example, if you specify
+ /// `label='financial'` and `status='UPLOADED'`, only files with the label
+ /// "financial" AND status UPLOADED will be returned. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs index 9f2a1c7a..ad860b5e 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs @@ -17,12 +17,36 @@ public partial interface ILibraryManagementClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update File
+ /// Update the specified parameters of a specific document in the user's library.
+ /// This operation currently supports updating the publicUrl and labels parameters.
+ /// > **This operation overwrites the specified items with the new data you provide.**
+ /// > If you wish to add new labels to the labels list without removing the existing ones,
+ /// > you must submit a labels list that includes both the current and new labels.**
+ /// >
+ /// > For instance, if the current labels are "Label A" and "Label B", and you wish to
+ /// > add "New Label C" and "New Label D" to the list, you must specify `"labels": ["Label A", "Label B", "New Label C", "New Label D"]`. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + + global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update File
@@ -45,12 +69,14 @@ public partial interface ILibraryManagementClient /// Any labels to associate with this file. Separate multiple labels with commas. If
/// provided, will overwrite all existing labels. /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, string? publicUrl = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs index 37d5eadc..e04b7654 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs @@ -14,11 +14,31 @@ public partial interface ILibraryManagementClient /// - **Supported file types:** PDF, DocX, HTML, TXT ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryUploadAsync( global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + + global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Upload Workspace File
@@ -41,6 +61,7 @@ public partial interface ILibraryManagementClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryUploadAsync( @@ -54,6 +75,86 @@ public partial interface ILibraryManagementClient global::System.Guid? batchId = default, string? dataSource = default, string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1LibraryUploadAsync( + global::System.IO.Stream file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs index 12d429b5..34bf6de6 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs @@ -32,6 +32,11 @@ public partial interface ILibraryManagementClient : global::System.IDisposable /// ensuring is populated. ///
public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs index 7b721ea8..26a357c8 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs @@ -8,10 +8,23 @@ public partial interface IRagEngineClient /// Get Batch Ingestion Status /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagementAsync( global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Batch Ingestion Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagementAsResponseAsync( + global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs index a37a12c3..ec5592af 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs @@ -8,10 +8,23 @@ public partial interface IRagEngineClient /// Generate Documents Signed Url /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Documents Signed Url + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs index 1d04ab46..cb271fa6 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs @@ -9,10 +9,24 @@ public partial interface IRagEngineClient /// Download parsed document with Content-Disposition header for immediate download. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Parsed Document
+ /// Download parsed document with Content-Disposition header for immediate download. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs index 8cc4dd80..38a949f3 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs @@ -8,11 +8,25 @@ public partial interface IRagEngineClient /// Search /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibrarySearchAsync( global::AI21.LibrarySearchRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibrarySearchAsResponseAsync( + + global::AI21.LibrarySearchRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Search @@ -34,6 +48,7 @@ public partial interface IRagEngineClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibrarySearchAsync( @@ -48,6 +63,7 @@ public partial interface IRagEngineClient int? maxNeighbors = default, double? retrievalSimilarityThreshold = default, double? hybridSearchAlpha = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs index bcec7a40..4bbac4af 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs @@ -32,6 +32,11 @@ public partial interface IRagEngineClient : global::System.IDisposable /// ensuring is populated. /// public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs index 7972c8bb..ab6bd642 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs @@ -7,9 +7,20 @@ public partial interface ISecretsClient /// /// Get Secret List /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorageAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Secret List + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SecretStorageAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs index 81dddf19..0056dc09 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs @@ -8,22 +8,38 @@ public partial interface ISecretsClient /// Save Secret /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage2Async( global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Save Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SecretStorage2AsResponseAsync( + + global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Save Secret /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage2Async( string secretName, string secretValue, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs index 1613c0ed..a0cbac6c 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs @@ -8,10 +8,23 @@ public partial interface ISecretsClient /// Delete Secret /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage3Async( string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SecretStorage3AsResponseAsync( + string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs index fc445689..52ba1a54 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs @@ -9,12 +9,28 @@ public partial interface ISecretsClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Secret + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SecretStorage4AsResponseAsync( + string secretId, + + global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Secret @@ -22,12 +38,14 @@ public partial interface ISecretsClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, string? secretName = default, string? secretValue = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs index c907e634..b402273c 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs @@ -32,6 +32,11 @@ public partial interface ISecretsClient : global::System.IDisposable /// ensuring is populated. /// public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs index 86d9cef2..399bd67c 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs @@ -8,11 +8,25 @@ public partial interface IWebsiteConnectorClient /// Create Client Config /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorCreateConfigAsync( global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Client Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorCreateConfigAsResponseAsync( + + global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Client Config @@ -27,6 +41,7 @@ public partial interface IWebsiteConnectorClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorCreateConfigAsync( @@ -36,6 +51,7 @@ public partial interface IWebsiteConnectorClient bool? extractLinkedFiles = default, bool? waitForDynamicContent = default, string? localization = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs index e3f97956..9f6fe084 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs @@ -8,10 +8,23 @@ public partial interface IWebsiteConnectorClient /// Get Client Config /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorGetConfigAsync( string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Client Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorGetConfigAsResponseAsync( + string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs index 3a652a93..56946002 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs @@ -8,10 +8,23 @@ public partial interface IWebsiteConnectorClient /// Get Url Status /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorGetUrlStatusAsync( string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Url Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorGetUrlStatusAsResponseAsync( + string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs index 0d7b7b51..8925e60a 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs @@ -8,10 +8,23 @@ public partial interface IWebsiteConnectorClient /// Get Website Status /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorGetWebsiteStatusAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Website Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorGetWebsiteStatusAsResponseAsync( + global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs index 07093148..53a18963 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs @@ -8,20 +8,36 @@ public partial interface IWebsiteConnectorClient /// Connect Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Connect Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestUrlAsResponseAsync( + + global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Connect Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs index bb85a042..02d2ed1f 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs @@ -8,11 +8,25 @@ public partial interface IWebsiteConnectorClient /// Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Ingest Website @@ -20,12 +34,14 @@ public partial interface IWebsiteConnectorClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( string sitemapUrl, string? clientConfig = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs index 0bb623fa..022471df 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs @@ -8,20 +8,36 @@ public partial interface IWebsiteConnectorClient /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retry Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorRetryIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs index 8ea65461..6cbae123 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs @@ -32,6 +32,11 @@ public partial interface IWebsiteConnectorClient : global::System.IDisposable /// ensuring is populated. /// public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs index 9d36c496..ca03f617 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs @@ -14,6 +14,7 @@ public partial class JambaCompleteClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -49,11 +50,40 @@ partial void ProcessV1ChatCompleteResponseContent( /// token is generated, rather than waiting for the entire response. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ChatCompleteAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Studio Chat Complete
+ /// This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).
+ /// This is a foundation model that supports both single-turn (question answering,
+ /// text completion) and multi-turn (chat style) interactions.
+ /// You can optionally stream results if you want to get the response as each
+ /// token is generated, rather than waiting for the entire response. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>>> V1ChatCompleteAsResponseAsync( + + global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +100,44 @@ partial void ProcessV1ChatCompleteResponseContent( securityRequirements: s_V1ChatCompleteSecurityRequirements, operationName: "V1ChatCompleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/chat/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/completions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,156 +147,336 @@ partial void ProcessV1ChatCompleteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ChatCompleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ChatCompleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ChatCompleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/v1/chat/completions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/v1/chat/completions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/v1/chat/completions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ChatCompleteResponseContent( + response: __response); + ProcessV1ChatCompleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AnyOf>.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/v1/chat/completions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/v1/chat/completions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AnyOf>.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ChatCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AnyOf>.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.AnyOf>.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Studio Chat Complete
@@ -313,6 +545,7 @@ partial void ProcessV1ChatCompleteResponseContent( /// /// Default Value: {"type":"text"} /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( @@ -328,6 +561,7 @@ partial void ProcessV1ChatCompleteResponseContent( global::AI21.MockResponseConfig? mockResponse = default, global::System.Collections.Generic.IList? documents = default, global::AI21.ResponseFormat? responseFormat = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.ChatRequest @@ -348,6 +582,7 @@ partial void ProcessV1ChatCompleteResponseContent( return await V1ChatCompleteAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs index 0d11eb06..c98f5abf 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class JambaCompleteClient : global::AI21.IJambaCompleteCli #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public JambaCompleteClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the JambaCompleteClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public JambaCompleteClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the JambaCompleteClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public JambaCompleteClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, bool disposeHttpClient = true) { + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs index 32f791d7..724f46b9 100644 --- a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs @@ -3,7 +3,7 @@ namespace AI21.JsonConverters { /// - public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T1, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T2> : global::System.Text.Json.Serialization.JsonConverter> + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> { /// public override global::AI21.AnyOf Read( @@ -107,7 +107,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null) + { try { diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs index 35bb24f2..989d04a0 100644 --- a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs @@ -3,7 +3,7 @@ namespace AI21.JsonConverters { /// - public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T1, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T2, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T3, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T4> : global::System.Text.Json.Serialization.JsonConverter> + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> { /// public override global::AI21.AnyOf Read( @@ -167,7 +167,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -181,7 +184,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -195,7 +201,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs index cde9bcb7..b64b07d9 100644 --- a/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs @@ -138,7 +138,10 @@ public class QueryFilterJsonConverter : global::System.Text.Json.Serialization.J catch (global::System.InvalidOperationException) { } + } + if (comparisonOperator == null && logicalOperator == null && queryFilterVariant3 == null) + { try { @@ -152,7 +155,10 @@ public class QueryFilterJsonConverter : global::System.Text.Json.Serialization.J catch (global::System.InvalidOperationException) { } + } + if (comparisonOperator == null && logicalOperator == null && queryFilterVariant3 == null) + { try { diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs index 16ed4c45..16d57dcf 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,10 +48,35 @@ partial void ProcessV1LibraryDeleteResponseContent( /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryDeleteAsync( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryDeleteAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete File
+ /// Delete the specified file from the library.
+ /// **Restrictions**:
+ /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryDeleteAsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -65,22 +91,44 @@ partial void ProcessV1LibraryDeleteResponseContent( securityRequirements: s_V1LibraryDeleteSecurityRequirements, operationName: "V1LibraryDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +138,326 @@ partial void ProcessV1LibraryDeleteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "DELETE", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryDeleteResponseContent( + response: __response); + ProcessV1LibraryDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs index a3efe391..c7a39182 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -65,6 +66,7 @@ partial void ProcessV1LibraryManagementResponseContent( /// Default Value: 500000 /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> V1LibraryManagementAsync( @@ -74,6 +76,48 @@ partial void ProcessV1LibraryManagementResponseContent( global::System.Collections.Generic.IList? label = default, int? limit = default, int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagementAsResponseAsync( + name: name, + path: path, + status: status, + label: label, + limit: limit, + offset: offset, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workspace Files
+ /// Get metadata about a specific file by file ID. The file ID is generated by
+ /// AI21 when you upload the file. + ///
+ /// + /// + /// + /// An enumeration. + /// + /// + /// + /// Default Value: 500000 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> V1LibraryManagementAsResponseAsync( + string? name = default, + string? path = default, + global::AI21.FileStatus? status = default, + global::System.Collections.Generic.IList? label = default, + int? limit = default, + int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -93,30 +137,52 @@ partial void ProcessV1LibraryManagementResponseContent( securityRequirements: s_V1LibraryManagementSecurityRequirements, operationName: "V1LibraryManagementAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/library/files", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("name", name) - .AddOptionalParameter("path", path) - .AddOptionalParameter("status", status?.ToValueString()) - .AddOptionalParameter("label", label, delimiter: ",", explode: true) - .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("offset", offset?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("name", name) + .AddOptionalParameter("path", path) + .AddOptionalParameter("status", status?.ToValueString()) + .AddOptionalParameter("label", label, delimiter: ",", explode: true) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -126,155 +192,335 @@ partial void ProcessV1LibraryManagementResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagementRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name, - path: path, - status: status, - label: label, - limit: limit, - offset: offset); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagementRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name, + path: path, + status: status, + label: label, + limit: limit, + offset: offset); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagementResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/files\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/files\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/files\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagementResponseContent( + response: __response); + ProcessV1LibraryManagementResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/files\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/files\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs index 62f145da..2740e60a 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -52,10 +53,40 @@ partial void ProcessV1LibraryManagement2ResponseContent( /// "financial" AND status UPLOADED will be returned. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement2AsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get File By Id
+ /// Retrieve a list of documents in the user's library. Optionally specify a
+ /// filter to find only files with matching labels or paths. This method
+ /// returns only metadata about files; to download a file, call
+ /// `GET .../files/{file_id}/download`
+ /// When specifying qualifiers with your request, only files that match
+ /// _all_ qualifiers will be returns. So, for example, if you specify
+ /// `label='financial'` and `status='UPLOADED'`, only files with the label
+ /// "financial" AND status UPLOADED will be returned. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -70,22 +101,44 @@ partial void ProcessV1LibraryManagement2ResponseContent( securityRequirements: s_V1LibraryManagement2SecurityRequirements, operationName: "V1LibraryManagement2Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,150 +148,330 @@ partial void ProcessV1LibraryManagement2ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagement2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement2ResponseContent( + response: __response); + ProcessV1LibraryManagement2Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.FileResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.FileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs index 79f74a8e..9fe5b9b2 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -55,12 +56,47 @@ partial void ProcessV1LibraryManagement3ResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement3AsResponseAsync( + fileId: fileId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update File
+ /// Update the specified parameters of a specific document in the user's library.
+ /// This operation currently supports updating the publicUrl and labels parameters.
+ /// > **This operation overwrites the specified items with the new data you provide.**
+ /// > If you wish to add new labels to the labels list without removing the existing ones,
+ /// > you must submit a labels list that includes both the current and new labels.**
+ /// >
+ /// > For instance, if the current labels are "Label A" and "Label B", and you wish to
+ /// > add "New Label C" and "New Label D" to the list, you must specify `"labels": ["Label A", "Label B", "New Label C", "New Label D"]`. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + + global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -78,22 +114,44 @@ partial void ProcessV1LibraryManagement3ResponseContent( securityRequirements: s_V1LibraryManagement3SecurityRequirements, operationName: "V1LibraryManagement3Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Put, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Put, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -103,153 +161,333 @@ partial void ProcessV1LibraryManagement3ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagement3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "PUT", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "PUT", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "PUT", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement3ResponseContent( + response: __response); + ProcessV1LibraryManagement3Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "PUT", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + httpMethod: "PUT", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update File
@@ -272,12 +510,14 @@ partial void ProcessV1LibraryManagement3ResponseContent( /// Any labels to associate with this file. Separate multiple labels with commas. If
/// provided, will overwrite all existing labels. /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, string? publicUrl = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.FilesUpdateRequest @@ -289,6 +529,7 @@ partial void ProcessV1LibraryManagement3ResponseContent( return await V1LibraryManagement3Async( fileId: fileId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs index 557fc8c8..813299da 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,11 +51,41 @@ partial void ProcessV1LibraryUploadResponseContent( /// - **Supported file types:** PDF, DocX, HTML, TXT ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryUploadAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + + global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -71,22 +102,44 @@ partial void ProcessV1LibraryUploadResponseContent( securityRequirements: s_V1LibraryUploadSecurityRequirements, operationName: "V1LibraryUploadAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/library/files", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -96,212 +149,1024 @@ partial void ProcessV1LibraryUploadResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; + } } - if (request.Path != default) - { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Path}"), - name: "\"path\""); - } - if (request.Labels != default) - { + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), - name: "\"labels\""); - } - if (request.PublicUrl != default) - { + if (request.Path != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.PublicUrl}"), - name: "\"publicUrl\""); - } - if (request.CustomConfigs != default) - { + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Path ?? string.Empty), + name: "\"path\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.CustomConfigs}"), - name: "\"custom_configs\""); - } - if (request.UploadMode != default) - { + } + if (request.Labels != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.UploadMode?.ToValueString()}"), - name: "\"upload_mode\""); - } - if (request.BatchId != default) - { + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), + name: "\"labels\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.BatchId}"), - name: "\"batch_id\""); - } - if (request.DataSource != default) - { + } + if (request.PublicUrl != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.DataSource}"), - name: "\"data_source\""); - } - if (request.Metadata != default) - { + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.PublicUrl ?? string.Empty), + name: "\"publicUrl\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Metadata}"), - name: "\"metadata\""); - } - __httpRequest.Content = __httpRequestContent; + } + if (request.CustomConfigs != default) + { - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryUploadRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomConfigs ?? string.Empty), + name: "\"custom_configs\""); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + } + if (request.UploadMode != default) + { - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryUploadResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UploadMode).HasValue ? (request.UploadMode).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upload_mode\""); + + } + if (request.BatchId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.BatchId.ToString() ?? string.Empty), + name: "\"batch_id\""); + + } + if (request.DataSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DataSource ?? string.Empty), + name: "\"data_source\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryUploadResponseContent( + response: __response); + ProcessV1LibraryUploadResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( + byte[] file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyV1LibraryUpload + { + File = file, + Filename = filename, + Path = path, + Labels = labels, + PublicUrl = publicUrl, + CustomConfigs = customConfigs, + UploadMode = uploadMode, + BatchId = batchId, + DataSource = dataSource, + Metadata = metadata, + }; + + return await V1LibraryUploadAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( + global::System.IO.Stream file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyV1LibraryUpload + { + File = global::System.Array.Empty(), + Filename = filename, + Path = path, + Labels = labels, + PublicUrl = publicUrl, + CustomConfigs = customConfigs, + UploadMode = uploadMode, + BatchId = batchId, + DataSource = dataSource, + Metadata = metadata, + }; + PrepareArguments( + client: HttpClient); + PrepareV1LibraryUploadArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1LibraryUploadSecurityRequirements, + operationName: "V1LibraryUploadAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - ).ConfigureAwait(false); - return __content; + 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); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") { - string? __content = null; + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Path != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Path ?? string.Empty), + name: "\"path\""); + + } + if (request.Labels != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), + name: "\"labels\""); + + } + if (request.PublicUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.PublicUrl ?? string.Empty), + name: "\"publicUrl\""); + + } + if (request.CustomConfigs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomConfigs ?? string.Empty), + name: "\"custom_configs\""); + + } + if (request.UploadMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UploadMode).HasValue ? (request.UploadMode).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upload_mode\""); + + } + if (request.BatchId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.BatchId.ToString() ?? string.Empty), + name: "\"batch_id\""); + + } + if (request.DataSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DataSource ?? string.Empty), + name: "\"data_source\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1LibraryUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); } } /// @@ -313,7 +1178,9 @@ partial void ProcessV1LibraryUploadResponseContent( /// - **Max library size:** 1 GB total size. No limit to individual file size.
/// - **Supported file types:** PDF, DocX, HTML, TXT ///
- /// + /// + /// The stream to send as the multipart 'file' file part. + /// /// /// /// @@ -325,10 +1192,11 @@ partial void ProcessV1LibraryUploadResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + global::System.IO.Stream file, string filename, string? path = default, global::System.Collections.Generic.IList? labels = default, @@ -338,11 +1206,14 @@ partial void ProcessV1LibraryUploadResponseContent( global::System.Guid? batchId = default, string? dataSource = default, string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyV1LibraryUpload + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyV1LibraryUpload { - File = file, + File = global::System.Array.Empty(), Filename = filename, Path = path, Labels = labels, @@ -353,10 +1224,492 @@ partial void ProcessV1LibraryUploadResponseContent( DataSource = dataSource, Metadata = metadata, }; + PrepareArguments( + client: HttpClient); + PrepareV1LibraryUploadArguments( + httpClient: HttpClient, + request: request); - return await V1LibraryUploadAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1LibraryUploadSecurityRequirements, + operationName: "V1LibraryUploadAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Path != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Path ?? string.Empty), + name: "\"path\""); + + } + if (request.Labels != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), + name: "\"labels\""); + + } + if (request.PublicUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.PublicUrl ?? string.Empty), + name: "\"publicUrl\""); + + } + if (request.CustomConfigs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomConfigs ?? string.Empty), + name: "\"custom_configs\""); + + } + if (request.UploadMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UploadMode).HasValue ? (request.UploadMode).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upload_mode\""); + + } + if (request.BatchId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.BatchId.ToString() ?? string.Empty), + name: "\"batch_id\""); + + } + if (request.DataSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DataSource ?? string.Empty), + name: "\"data_source\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1LibraryUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/files\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs index 167b6395..90aacca1 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class LibraryManagementClient : global::AI21.ILibraryManag #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public LibraryManagementClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LibraryManagementClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LibraryManagementClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LibraryManagementClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LibraryManagementClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, bool disposeHttpClient = true) { + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs b/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs index 2c380d15..02763ca1 100644 --- a/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs @@ -274,5 +274,6 @@ public Assistant( public Assistant() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs index 49e67f48..f2c7dfaa 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs @@ -56,5 +56,6 @@ public AssistantBasicInfo( public AssistantBasicInfo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs index 36c7b0c4..7b3b49d1 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class AssistantConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs index 5384e5d0..34c048e2 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs @@ -89,5 +89,6 @@ public AssistantMessage( public AssistantMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs index 2c1b1cb0..a20a2653 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs @@ -116,5 +116,6 @@ public AssistantRoute( public AssistantRoute() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs index 131c9442..be92f0a1 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs @@ -40,5 +40,6 @@ public AssistantsByMcpResponse( public AssistantsByMcpResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 138392fe..d08d1dbb 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -40,5 +40,6 @@ public BodyConvertDocumentFileStudioV1ChatFilesConvertPost( public BodyConvertDocumentFileStudioV1ChatFilesConvertPost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs index 28174963..f55cbb7e 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs @@ -50,5 +50,6 @@ public BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost( public BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs index e0005551..50a060a5 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs @@ -78,5 +78,6 @@ public BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost( public BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs index 225c010f..36b116cd 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs @@ -72,5 +72,6 @@ public BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePos public BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs index 10d8f2e7..a41736bb 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs @@ -125,5 +125,6 @@ public BodyV1LibraryUpload( public BodyV1LibraryUpload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs index 2c361bd5..ee413dd4 100644 --- a/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CanIframeStudioV1DemosScraperCanIframeGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs index 36e1dccf..66a6b367 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs @@ -81,5 +81,6 @@ public ChatCompletion( public ChatCompletion() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs index 423ff9b8..4f75594f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionMeta /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs index 44670b06..d7985777 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs @@ -85,5 +85,6 @@ public ChatCompletionResponseChoice( public ChatCompletionResponseChoice() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs index a17874e8..93da7b5b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs @@ -87,5 +87,6 @@ public ChatCompletionResponseDeltaChoice( public ChatCompletionResponseDeltaChoice() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs index 246be14a..ea9458fa 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs @@ -78,5 +78,6 @@ public ChatCompletionVllmStreamingMessage( public ChatCompletionVllmStreamingMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs index 1919626d..ac902f78 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionVllmStreamingMessageMeta /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs index 37b23ac8..19b7bfd6 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs @@ -216,5 +216,6 @@ public ChatRequest( public ChatRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs index 5e68e13c..d406e931 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs @@ -40,5 +40,6 @@ public ChatRequestMessageDiscriminator( public ChatRequestMessageDiscriminator() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs index 0572388b..5faf535e 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs @@ -40,5 +40,6 @@ public ChatStreamingContentDelta( public ChatStreamingContentDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs index 43ab9208..d1053941 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs @@ -61,5 +61,6 @@ public ChatStreamingFirstDelta( public ChatStreamingFirstDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs index 63c05e1a..30dc4d6e 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs @@ -40,5 +40,6 @@ public ChatStreamingToolCallsDelta( public ChatStreamingToolCallsDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs index 94ca76d2..e9fe3e4c 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs @@ -40,5 +40,6 @@ public ChatStreamingToolCallsFirstDelta( public ChatStreamingToolCallsFirstDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.Json.g.cs deleted file mode 100644 index 6feb73d5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ClarotyProductLookupSolutionsClarotyProductLookupPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse), - jsonSerializerContext) as global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.Json.g.cs deleted file mode 100644 index a8e9ecd8..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse), - jsonSerializerContext) as global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs index 77d2b2d5..25007661 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs @@ -50,5 +50,6 @@ public CompareTextRequest( public CompareTextRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs index 17d99f02..69dc1e1a 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CompareTextStudioV1DemosDocumentModifierCompareTextP /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs index 3bdefb14..e58a247a 100644 --- a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs @@ -14,5 +14,6 @@ public sealed partial class ComparisonOperator /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.g.cs index 4be7cfd5..df14e5e6 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.g.cs @@ -81,5 +81,6 @@ public ConnectorConnectionStatus( public ConnectorConnectionStatus() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs index d7835198..7f2199d6 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs @@ -40,5 +40,6 @@ public ConnectorsDataSources( public ConnectorsDataSources() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs index 2b36ce79..95e9fa89 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs @@ -73,5 +73,6 @@ public ConnectorsStatus( public ConnectorsStatus() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.g.cs index 3d1e7c93..b321843e 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.g.cs @@ -88,5 +88,6 @@ public ConnectorsSyncParams( public ConnectorsSyncParams() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.g.cs index 503a158d..d407a8ba 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.g.cs @@ -14,5 +14,6 @@ public sealed partial class ConnectorsSyncParamsConfiguration /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs index dc2c29e9..dd617b93 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs @@ -40,5 +40,6 @@ public ConnectorsToken( public ConnectorsToken() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs index 25d52590..e023eb45 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ConvertDocumentFileStudioV1ChatFilesConvertPostRespo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs index 9bcf018c..27bd2f39 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs @@ -154,5 +154,6 @@ public CreateAssistantRequest( public CreateAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs index f31f5970..5f30ff4e 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateAssistantRequestConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs index 869d433c..f0ae9746 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs @@ -98,5 +98,6 @@ public CreateMCPStorageRequest( public CreateMCPStorageRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs index dc1e378e..219bbe7e 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs @@ -210,5 +210,6 @@ public CreateMaestroRunsPayload( public CreateMaestroRunsPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs index 66088e51..9c3741c8 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateMaestroRunsPayloadContext /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs index c8efb8cd..1b534176 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateMaestroRunsPayloadCustomRetrievalConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs index 153b7013..c6ff7850 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateMaestroRunsPayloadOutputType /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs index 654b90a9..109a86c2 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs @@ -61,5 +61,6 @@ public CreateOrganizationSchemaRequest( public CreateOrganizationSchemaRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs index 745d990e..8df8aea2 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateOrganizationSchemaRequestSchemaObject /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs index 4ff0b1aa..af3040cb 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateOrganizationSchemaStudioV1StructuredRagOrganiz /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs index c594e651..3e999f48 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs @@ -49,5 +49,6 @@ public CreatePlanPayload( public CreatePlanPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs index 68da8c59..665ff712 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreatePlanPayloadSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs index 670ff368..0fcab1eb 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs @@ -70,5 +70,6 @@ public CreateRoutePayload( public CreateRoutePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs index 6dafd77c..b8ce9776 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs @@ -50,5 +50,6 @@ public CreateSecretPayload( public CreateSecretPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs index 647a0d1e..865f3c2c 100644 --- a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs @@ -80,5 +80,6 @@ public DataSourceMetadata( public DataSourceMetadata() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs index 4c4fdacb..97df09f0 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs @@ -68,5 +68,6 @@ public DeleteAssistantResponse( public DeleteAssistantResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs index 6f6e8b80..996f2fee 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteDemoStudioV1DemosDemoIdDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs index 80bef1c8..dbf493ee 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs @@ -46,5 +46,6 @@ public DeleteMCPStorageResponse( public DeleteMCPStorageResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs index f8a4be31..f0f6f86c 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteOrganizationSchemaStudioV1StructuredRagOrganiz /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.g.cs index c01c7a2e..bb156800 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConne /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.g.cs index 491da4d4..40d5586e 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteWorkspaceModelEndpointStudioV1SettingsModelsNa /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Demo.g.cs b/src/libs/AI21/Generated/AI21.Models.Demo.g.cs index 615b6254..3486f557 100644 --- a/src/libs/AI21/Generated/AI21.Models.Demo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Demo.g.cs @@ -107,5 +107,6 @@ public Demo( public Demo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs index 85efe952..f251d2a2 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class DemoConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs index a9c3a9e6..8b54a6c5 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs @@ -91,5 +91,6 @@ public DemoCreate( public DemoCreate() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs index 2004b319..849cd3d9 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class DemoCreateConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs index 4bea02cc..47b839c2 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs @@ -87,5 +87,6 @@ public DemoUpdate( public DemoUpdate() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs index a6c449f6..dda7c340 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class DemoUpdateConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs index 7265afc1..81e6957a 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs @@ -49,5 +49,6 @@ public DetectSchemaRequest( public DetectSchemaRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs index a2ef604a..d6fea2ee 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs @@ -50,5 +50,6 @@ public DetectSchemaResponse( public DetectSchemaResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs index a67fca73..bd89f014 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs @@ -14,5 +14,6 @@ public sealed partial class DetectSchemaResponseSchemaDefinition /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs index 1b517aba..d58b231f 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs @@ -50,5 +50,6 @@ public DocumentReference( public DocumentReference() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs index 138f50bb..311b3484 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs @@ -66,5 +66,6 @@ public DocumentSchema( public DocumentSchema() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs index 16893eb7..c0509de4 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class DocumentSchemaMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs index adb0e273..193b00c8 100644 --- a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs @@ -50,5 +50,6 @@ public DownloadModifiedDocumentRequest( public DownloadModifiedDocumentRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs index 014eef75..bbab2d37 100644 --- a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DownloadModifiedDocumentStudioV1DemosDocumentModifie /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs index e42f7d56..ac5c43f5 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs @@ -202,5 +202,6 @@ public FileResponse( public FileResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs index cfb3c164..26db1412 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs @@ -155,5 +155,6 @@ public FileSearchToolResource( public FileSearchToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs index fa191187..40162039 100644 --- a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs @@ -58,5 +58,6 @@ public FilesUpdateRequest( public FilesUpdateRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs deleted file mode 100644 index 5011e451..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs deleted file mode 100644 index 8b2a350b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs deleted file mode 100644 index e8bc55d2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs deleted file mode 100644 index aa29d960..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs deleted file mode 100644 index 59159123..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs deleted file mode 100644 index 50a158d5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 080d86cb..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.g.cs deleted file mode 100644 index f97f85e4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs deleted file mode 100644 index cf5ba652..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index fe5ba421..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs deleted file mode 100644 index 3bce0446..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index 0b57894f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 8b867e65..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.g.cs deleted file mode 100644 index 98353f33..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index a63dd691..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index dc2e89c2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index 6cd80939..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index 983d06ed..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.Json.g.cs deleted file mode 100644 index c5ced781..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.g.cs deleted file mode 100644 index 2b4c4dc5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs deleted file mode 100644 index 04c96a74..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index 6501dcfe..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index bfc4103f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.Json.g.cs deleted file mode 100644 index 66730cc2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.g.cs deleted file mode 100644 index 1caee80e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index cd05d290..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index a40e9e0c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index 2d90b72c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index aed48d22..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 30ed239b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.g.cs deleted file mode 100644 index 3145a868..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 3b1cce43..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.g.cs deleted file mode 100644 index 1d302569..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.Json.g.cs deleted file mode 100644 index da916e66..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.g.cs deleted file mode 100644 index 3ca25822..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs deleted file mode 100644 index 44517be6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.g.cs deleted file mode 100644 index 215f260f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs deleted file mode 100644 index 451d1b2c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.g.cs deleted file mode 100644 index 20c71661..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.Json.g.cs deleted file mode 100644 index c4829709..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.g.cs deleted file mode 100644 index 44697dd1..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.g.cs index 68d87d1d..47ad0160 100644 --- a/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ForwardParagonWebhookStudioV1ConnectorsParagonWebhoo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs index 22a92a03..1fc54b7c 100644 --- a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs @@ -58,5 +58,6 @@ public FunctionToolDefinition( public FunctionToolDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs index 8ff04ddb..7ad809c6 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs @@ -49,5 +49,6 @@ public GenerateAssistantRequest( public GenerateAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs index a73ece44..76dc166a 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs @@ -292,5 +292,6 @@ public GenerateAssistantResponse( public GenerateAssistantResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs index 44780c04..c495e756 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class GenerateAssistantResponseConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs index ee271d1b..96ea0da5 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs @@ -14,5 +14,6 @@ public sealed partial class GenerateAssistantResponseCustomToolNeeded /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs index bb8f0812..4fcc3990 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GenerateResponsePdfStudioV1DemosRfiGenerateResponseP /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs index 8fc391f1..0ee6ea6d 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetAvailableModelsEndpointStudioV1SettingsModelsAvai /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs index 030d8b50..73973954 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetFileUrlStudioV1DemosScraperFileUrlFileIdGetRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.g.cs index d64118b0..c73ef994 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetOutputExplanationStudioV1ExecutionsExecutionIdExp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs index 184eb2d4..e3a24106 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetParsedFileStudioV1DemosDocumentModifierGetParsedF /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.g.cs index f976ac87..da63ddf3 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetStepExplanationsStudioV1ExecutionsExecutionIdExpl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs index d748e0d8..5f9e6198 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetVectorStoreStudioV1DemosRegulationsVectorStoreVec /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.g.cs index 5b58467f..e0202adf 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConn /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.g.cs index ac1ce528..fda52b53 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetWebsiteConnectorStudioV1ConnectorsWebsiteGetRespo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs index 658f52ca..89b9d6c3 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs @@ -49,5 +49,6 @@ public HTTPToolEndpoint( public HTTPToolEndpoint() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs index cd18d603..5d5515b1 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs @@ -14,5 +14,6 @@ public sealed partial class HTTPToolEndpointHeaders /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs index d3ec688a..32eb6b24 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs @@ -60,5 +60,6 @@ public HTTPToolFunction( public HTTPToolFunction() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs index f09ed051..f46b2ce7 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs @@ -50,5 +50,6 @@ public HTTPToolFunctionParamProperties( public HTTPToolFunctionParamProperties() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs index a8019538..b7a3571e 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs @@ -62,5 +62,6 @@ public HTTPToolFunctionParameters( public HTTPToolFunctionParameters() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs index dfcb6800..7f43f808 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs @@ -14,5 +14,6 @@ public sealed partial class HTTPToolFunctionParametersProperties /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs index dc08b344..2bc60086 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs @@ -62,5 +62,6 @@ public HTTPToolResource( public HTTPToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs index 46a40562..eba0eaea 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs @@ -39,5 +39,6 @@ public HTTPValidationError( public HTTPValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs b/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs index 914fb046..6bd82913 100644 --- a/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs @@ -50,5 +50,6 @@ public IgnestionBatchStatusCount( public IgnestionBatchStatusCount() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs index 28ea3e97..7c067a34 100644 --- a/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs @@ -66,5 +66,6 @@ public IngestionBatchStatusResponse( public IngestionBatchStatusResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs index 3a960c88..741707e9 100644 --- a/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs @@ -69,5 +69,6 @@ public JambaExecuteRequest( public JambaExecuteRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs index 0ee7306f..ac5c3c8a 100644 --- a/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class JambaExecuteStudioV1DemosDocumentModifierJambaExecut /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.Json.g.cs deleted file mode 100644 index 50a09613..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse), - jsonSerializerContext) as global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.g.cs deleted file mode 100644 index 418c4b6f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.Json.g.cs deleted file mode 100644 index d805bfee..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse), - jsonSerializerContext) as global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.g.cs deleted file mode 100644 index cccd8529..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.Json.g.cs deleted file mode 100644 index 09ec9ba3..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse), - jsonSerializerContext) as global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.g.cs deleted file mode 100644 index 444cfe20..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.Json.g.cs deleted file mode 100644 index 941976a5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.g.cs deleted file mode 100644 index cf1eca4d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.Json.g.cs deleted file mode 100644 index a14e4fd4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.g.cs deleted file mode 100644 index 1c053a31..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.Json.g.cs deleted file mode 100644 index ea5c20b6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse), - jsonSerializerContext) as global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.g.cs deleted file mode 100644 index ec4c20df..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.Json.g.cs deleted file mode 100644 index 30382f99..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse), - jsonSerializerContext) as global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.g.cs deleted file mode 100644 index eec4a5b5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.Json.g.cs deleted file mode 100644 index 40713fbc..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse), - jsonSerializerContext) as global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.g.cs deleted file mode 100644 index 57242cdb..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse.Json.g.cs similarity index 75% rename from src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse.Json.g.cs index 606a2f32..e1b5d055 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse + public sealed partial class KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse), + jsonSerializerContext) as global::AI21.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse.g.cs similarity index 77% rename from src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse.g.cs index b5d81d60..38030cac 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse + public sealed partial class KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGetResponse { /// @@ -14,5 +14,6 @@ public sealed partial class FnacAftersalesBatchPredictPrefixPreviewSolutionsPrev /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.Json.g.cs similarity index 77% rename from src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.Json.g.cs index 7b727bf8..c8514423 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse + public sealed partial class KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse), + jsonSerializerContext) as global::AI21.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.g.cs similarity index 79% rename from src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.g.cs index 8e3ca11c..13abc852 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse + public sealed partial class KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse { /// @@ -14,5 +14,6 @@ public sealed partial class FnacAftersalesBatchPredictSolutionsFdAftersalesParts /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse.Json.g.cs similarity index 76% rename from src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse.Json.g.cs index a7797a71..a2e92942 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse + public sealed partial class KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse), + jsonSerializerContext) as global::AI21.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse.g.cs similarity index 78% rename from src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse.g.cs index fc62dc07..f279f6a7 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse + public sealed partial class KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPostResponse { /// @@ -14,5 +14,6 @@ public sealed partial class FnacV1DeprecatedClassificationsPrefixPreviewSolution /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.Json.g.cs similarity index 78% rename from src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.Json.g.cs index 304db196..b5bfa09d 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse + public sealed partial class KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse), + jsonSerializerContext) as global::AI21.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse? FromJson( + public static global::AI21.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse; + typeof(global::AI21.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.g.cs similarity index 80% rename from src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.g.cs index 191c7f10..cfbda6ac 100644 --- a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse + public sealed partial class KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse { /// @@ -14,5 +14,6 @@ public sealed partial class ClarotySuggestVendorModelSolutionsClarotySuggestVend /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.g.cs deleted file mode 100644 index 69234d49..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.g.cs deleted file mode 100644 index 8788e910..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs index bfa204a5..54c530c3 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs @@ -72,5 +72,6 @@ public LanguageStudioApiServerDataTypesAssistantRequirement( public LanguageStudioApiServerDataTypesAssistantRequirement() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs index 7304f9c0..dd59947c 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs @@ -50,5 +50,6 @@ public LanguageStudioApiServerDataTypesChatToolDefinition( public LanguageStudioApiServerDataTypesChatToolDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs index 3ee02773..bb00112b 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs @@ -59,5 +59,6 @@ public LanguageStudioApiServerDataTypesExecutionEngineRequirement( public LanguageStudioApiServerDataTypesExecutionEngineRequirement() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs index 7dfce32c..c1f775ea 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs @@ -31,6 +31,26 @@ namespace AI21 #endif public bool IsHttp => Http != null; + /// + /// + /// + public bool TryPickHttp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.HTTPToolResource? value) + { + value = Http; + return IsHttp; + } + + /// + /// + /// + public global::AI21.HTTPToolResource PickHttp() => IsHttp + ? Http! + : throw new global::System.InvalidOperationException($"Expected union variant 'Http' but the value was {ToString()}."); + /// /// /// @@ -48,6 +68,26 @@ namespace AI21 #endif public bool IsMcp => Mcp != null; + /// + /// + /// + public bool TryPickMcp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.MCPToolResource? value) + { + value = Mcp; + return IsMcp; + } + + /// + /// + /// + public global::AI21.MCPToolResource PickMcp() => IsMcp + ? Mcp! + : throw new global::System.InvalidOperationException($"Expected union variant 'Mcp' but the value was {ToString()}."); + /// /// /// @@ -65,6 +105,26 @@ namespace AI21 #endif public bool IsFileSearch => FileSearch != null; + /// + /// + /// + public bool TryPickFileSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.FileSearchToolResource? value) + { + value = FileSearch; + return IsFileSearch; + } + + /// + /// + /// + public global::AI21.FileSearchToolResource PickFileSearch() => IsFileSearch + ? FileSearch! + : throw new global::System.InvalidOperationException($"Expected union variant 'FileSearch' but the value was {ToString()}."); + /// /// /// @@ -81,6 +141,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(WebSearch))] #endif public bool IsWebSearch => WebSearch != null; + + /// + /// + /// + public bool TryPickWebSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.WebSearchToolResource? value) + { + value = WebSearch; + return IsWebSearch; + } + + /// + /// + /// + public global::AI21.WebSearchToolResource PickWebSearch() => IsWebSearch + ? WebSearch! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearch' but the value was {ToString()}."); /// /// /// @@ -99,6 +179,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 Http = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromHttp(global::AI21.HTTPToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -117,6 +202,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 Mcp = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromMcp(global::AI21.MCPToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -135,6 +225,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 FileSearch = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromFileSearch(global::AI21.FileSearchToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -153,6 +248,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 WebSearch = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromWebSearch(global::AI21.WebSearchToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -204,10 +304,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? http = null, - global::System.Func? mcp = null, - global::System.Func? fileSearch = null, - global::System.Func? webSearch = null, + global::System.Func? http = null, + global::System.Func? mcp = null, + global::System.Func? fileSearch = null, + global::System.Func? webSearch = null, bool validate = true) { if (validate) @@ -239,10 +339,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? http = null, - global::System.Action? mcp = null, - global::System.Action? fileSearch = null, - global::System.Action? webSearch = null, + global::System.Action? http = null, + + global::System.Action? mcp = null, + + global::System.Action? fileSearch = null, + + global::System.Action? webSearch = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsHttp) + { + http?.Invoke(Http!); + } + else if (IsMcp) + { + mcp?.Invoke(Mcp!); + } + else if (IsFileSearch) + { + fileSearch?.Invoke(FileSearch!); + } + else if (IsWebSearch) + { + webSearch?.Invoke(WebSearch!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? http = null, + global::System.Action? mcp = null, + global::System.Action? fileSearch = null, + global::System.Action? webSearch = null, bool validate = true) { if (validate) diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs index f8fdb45a..149e036b 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs @@ -40,5 +40,6 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminato public LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs index 98241032..9c00f837 100644 --- a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs @@ -139,5 +139,6 @@ public LibrarySearchRequest( public LibrarySearchRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs index d64ad03a..bd608b83 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs @@ -40,5 +40,6 @@ public ListAssistantsResponse( public ListAssistantsResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs index a46446ca..e2a96b2b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs @@ -40,5 +40,6 @@ public ListMCPsStorageResponse( public ListMCPsStorageResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs index 599d9f82..dace0404 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs @@ -40,5 +40,6 @@ public ListPlansResponse( public ListPlansResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs index 5a410b01..bdb79aee 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs @@ -40,5 +40,6 @@ public ListRoutesResponse( public ListRoutesResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs index 1d230ef2..3b317041 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogicalOperator /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs index 62dfcefd..80339491 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogicalOperatorItem /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs b/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs index 9563f7e9..ffa057dc 100644 --- a/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs @@ -40,5 +40,6 @@ public Logprobs( public Logprobs() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs b/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs index 5f879f83..15a235eb 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs @@ -59,5 +59,6 @@ public LogprobsData( public LogprobsData() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs index b59b38f9..e3d95b5a 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs @@ -58,5 +58,6 @@ public MCPDefinition( public MCPDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs index 88817a45..cd9169de 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs @@ -14,5 +14,6 @@ public sealed partial class MCPDefinitionHeaders /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs index a8a6ba24..417a5473 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs @@ -50,5 +50,6 @@ public MCPDiscoveryResponse( public MCPDiscoveryResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs index e400932c..f3f1a43b 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs @@ -134,5 +134,6 @@ public MCPStorageResponse( public MCPStorageResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs index 2ffcaa21..f4f5b4aa 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs @@ -59,5 +59,6 @@ public MCPTool( public MCPTool() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs index 7b3813e2..96d26a08 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class MCPToolInputSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs index cf7ca151..c5f21123 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs @@ -87,5 +87,6 @@ public MCPToolResource( public MCPToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs index e4054231..59f2fb12 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs @@ -14,5 +14,6 @@ public sealed partial class MCPToolResourceHeaders /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs index 38c69bee..370723c1 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs @@ -40,5 +40,6 @@ public MaestroRunError( public MaestroRunError() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs index e84d8f97..52929e92 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs @@ -43,6 +43,12 @@ public sealed partial class MaestroRunResult [global::System.Text.Json.Serialization.JsonPropertyName("requirements_result")] public object? RequirementsResult { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + public global::System.DateTime? CreatedAt { get; set; } + /// /// /// @@ -67,6 +73,7 @@ public sealed partial class MaestroRunResult /// /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -77,6 +84,7 @@ public MaestroRunResult( object? result, object? dataSources, object? requirementsResult, + global::System.DateTime? createdAt, global::AI21.MaestroRunError? error) { this.Id = id; @@ -84,6 +92,7 @@ public MaestroRunResult( this.Result = result; this.DataSources = dataSources; this.RequirementsResult = requirementsResult; + this.CreatedAt = createdAt; this.Error = error; } @@ -93,5 +102,6 @@ public MaestroRunResult( public MaestroRunResult() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs index 291430d4..2d08b68b 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs @@ -14,5 +14,6 @@ public sealed partial class MaestroRunResultDataSources /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs index dde2a51d..ab211bb3 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs @@ -14,5 +14,6 @@ public sealed partial class MaestroRunResultRequirementsResult /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs index c08df558..937e41e0 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs @@ -14,5 +14,6 @@ public sealed partial class MaestroRunResultResult /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs index 841b24ff..4816a773 100644 --- a/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs @@ -42,5 +42,6 @@ public MarkdownRequest( public MarkdownRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Message.g.cs b/src/libs/AI21/Generated/AI21.Models.Message.g.cs index ad6357c0..81a68d7b 100644 --- a/src/libs/AI21/Generated/AI21.Models.Message.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Message.g.cs @@ -71,5 +71,6 @@ public Message( public Message() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs b/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs index aeadc8fc..ae0df8d7 100644 --- a/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs @@ -31,6 +31,26 @@ namespace AI21 #endif public bool IsUser => User != null; + /// + /// + /// + public bool TryPickUser( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.UserMessage? value) + { + value = User; + return IsUser; + } + + /// + /// + /// + public global::AI21.UserMessage PickUser() => IsUser + ? User! + : throw new global::System.InvalidOperationException($"Expected union variant 'User' but the value was {ToString()}."); + /// /// /// @@ -48,6 +68,26 @@ namespace AI21 #endif public bool IsAssistant => Assistant != null; + /// + /// + /// + public bool TryPickAssistant( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.AssistantMessage? value) + { + value = Assistant; + return IsAssistant; + } + + /// + /// + /// + public global::AI21.AssistantMessage PickAssistant() => IsAssistant + ? Assistant! + : throw new global::System.InvalidOperationException($"Expected union variant 'Assistant' but the value was {ToString()}."); + /// /// /// @@ -65,6 +105,26 @@ namespace AI21 #endif public bool IsTool => Tool != null; + /// + /// + /// + public bool TryPickTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.ToolMessage? value) + { + value = Tool; + return IsTool; + } + + /// + /// + /// + public global::AI21.ToolMessage PickTool() => IsTool + ? Tool! + : throw new global::System.InvalidOperationException($"Expected union variant 'Tool' but the value was {ToString()}."); + /// /// /// @@ -81,6 +141,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(System))] #endif public bool IsSystem => System != null; + + /// + /// + /// + public bool TryPickSystem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.SystemMessage? value) + { + value = System; + return IsSystem; + } + + /// + /// + /// + public global::AI21.SystemMessage PickSystem() => IsSystem + ? System! + : throw new global::System.InvalidOperationException($"Expected union variant 'System' but the value was {ToString()}."); /// /// /// @@ -99,6 +179,11 @@ public MessagesItem(global::AI21.UserMessage? value) User = value; } + /// + /// + /// + public static MessagesItem FromUser(global::AI21.UserMessage? value) => new MessagesItem(value); + /// /// /// @@ -117,6 +202,11 @@ public MessagesItem(global::AI21.AssistantMessage? value) Assistant = value; } + /// + /// + /// + public static MessagesItem FromAssistant(global::AI21.AssistantMessage? value) => new MessagesItem(value); + /// /// /// @@ -135,6 +225,11 @@ public MessagesItem(global::AI21.ToolMessage? value) Tool = value; } + /// + /// + /// + public static MessagesItem FromTool(global::AI21.ToolMessage? value) => new MessagesItem(value); + /// /// /// @@ -153,6 +248,11 @@ public MessagesItem(global::AI21.SystemMessage? value) System = value; } + /// + /// + /// + public static MessagesItem FromSystem(global::AI21.SystemMessage? value) => new MessagesItem(value); + /// /// /// @@ -204,10 +304,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? user = null, - global::System.Func? assistant = null, - global::System.Func? tool = null, - global::System.Func? system = null, + global::System.Func? user = null, + global::System.Func? assistant = null, + global::System.Func? tool = null, + global::System.Func? system = null, bool validate = true) { if (validate) @@ -239,10 +339,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? user = null, - global::System.Action? assistant = null, - global::System.Action? tool = null, - global::System.Action? system = null, + global::System.Action? user = null, + + global::System.Action? assistant = null, + + global::System.Action? tool = null, + + global::System.Action? system = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsUser) + { + user?.Invoke(User!); + } + else if (IsAssistant) + { + assistant?.Invoke(Assistant!); + } + else if (IsTool) + { + tool?.Invoke(Tool!); + } + else if (IsSystem) + { + system?.Invoke(System!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? user = null, + global::System.Action? assistant = null, + global::System.Action? tool = null, + global::System.Action? system = null, bool validate = true) { if (validate) diff --git a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs index 0158c67c..69ae67e4 100644 --- a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs @@ -52,5 +52,6 @@ public MockResponseConfig( public MockResponseConfig() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs index 20ff99ce..b5e5a740 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs @@ -109,5 +109,6 @@ public ModelInfo( public ModelInfo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs index 4e71539a..47af72c0 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs @@ -50,5 +50,6 @@ public ModelPricing( public ModelPricing() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs index 7f68eee9..b6c58328 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs @@ -40,5 +40,6 @@ public ModelsInfoResponse( public ModelsInfoResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs index 8c66d175..1e4fca85 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs @@ -168,5 +168,6 @@ public ModifyAssistantRequest( public ModifyAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs index 5bcf0aeb..dddf000b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModifyAssistantRequestConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs index 7f895863..a3933745 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs @@ -70,5 +70,6 @@ public OrgSchema( public OrgSchema() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs index 4d32da91..50b8405f 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs @@ -14,5 +14,6 @@ public sealed partial class OrgSchemaSchemaDefinition /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs index 01810a89..c3b12944 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs @@ -14,5 +14,6 @@ public sealed partial class OrgSchemaTableStats /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs index eca78e5b..37a8faf7 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs @@ -40,5 +40,6 @@ public OrgSchemas( public OrgSchemas() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs index adacb312..9cb9e45c 100644 --- a/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ParsePdfStudioV1DemosDocumentModifierParsePdfPostRes /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Plan.g.cs b/src/libs/AI21/Generated/AI21.Models.Plan.g.cs index b89a2d2f..d63d5ef8 100644 --- a/src/libs/AI21/Generated/AI21.Models.Plan.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Plan.g.cs @@ -95,5 +95,6 @@ public Plan( public Plan() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs index bb600681..115afff9 100644 --- a/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class PlanSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.g.cs index bb29767d..8f405dbe 100644 --- a/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class PostWebsiteConnectorStudioV1ConnectorsWebsitePostRes /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs index b92a5ecc..aed57328 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs @@ -26,6 +26,26 @@ namespace AI21 #endif public bool IsComparisonOperator => ComparisonOperator != null; + /// + /// + /// + public bool TryPickComparisonOperator( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.ComparisonOperator? value) + { + value = ComparisonOperator; + return IsComparisonOperator; + } + + /// + /// + /// + public global::AI21.ComparisonOperator PickComparisonOperator() => IsComparisonOperator + ? ComparisonOperator! + : throw new global::System.InvalidOperationException($"Expected union variant 'ComparisonOperator' but the value was {ToString()}."); + /// /// /// @@ -43,6 +63,26 @@ namespace AI21 #endif public bool IsLogicalOperator => LogicalOperator != null; + /// + /// + /// + public bool TryPickLogicalOperator( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.Dictionary>? value) + { + value = LogicalOperator; + return IsLogicalOperator; + } + + /// + /// + /// + public global::System.Collections.Generic.Dictionary> PickLogicalOperator() => IsLogicalOperator + ? LogicalOperator! + : throw new global::System.InvalidOperationException($"Expected union variant 'LogicalOperator' but the value was {ToString()}."); + /// /// /// @@ -59,6 +99,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(QueryFilterVariant3))] #endif public bool IsQueryFilterVariant3 => QueryFilterVariant3 != null; + + /// + /// + /// + public bool TryPickQueryFilterVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.Dictionary? value) + { + value = QueryFilterVariant3; + return IsQueryFilterVariant3; + } + + /// + /// + /// + public global::System.Collections.Generic.Dictionary PickQueryFilterVariant3() => IsQueryFilterVariant3 + ? QueryFilterVariant3! + : throw new global::System.InvalidOperationException($"Expected union variant 'QueryFilterVariant3' but the value was {ToString()}."); /// /// /// @@ -77,6 +137,11 @@ public QueryFilter(global::AI21.ComparisonOperator? value) ComparisonOperator = value; } + /// + /// + /// + public static QueryFilter FromComparisonOperator(global::AI21.ComparisonOperator? value) => new QueryFilter(value); + /// /// /// @@ -95,6 +160,11 @@ public QueryFilter(global::System.Collections.Generic.Dictionary + /// + /// + public static QueryFilter FromLogicalOperator(global::System.Collections.Generic.Dictionary>? value) => new QueryFilter(value); + /// /// /// @@ -113,6 +183,11 @@ public QueryFilter(global::System.Collections.Generic.Dictionary + /// + /// + public static QueryFilter FromQueryFilterVariant3(global::System.Collections.Generic.Dictionary? value) => new QueryFilter(value); + /// /// /// @@ -157,9 +232,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? comparisonOperator = null, - global::System.Func>?, TResult>? logicalOperator = null, - global::System.Func?, TResult>? queryFilterVariant3 = null, + global::System.Func? comparisonOperator = null, + global::System.Func>, TResult>? logicalOperator = null, + global::System.Func, TResult>? queryFilterVariant3 = null, bool validate = true) { if (validate) @@ -187,9 +262,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? comparisonOperator = null, - global::System.Action>?>? logicalOperator = null, - global::System.Action?>? queryFilterVariant3 = null, + global::System.Action? comparisonOperator = null, + + global::System.Action>>? logicalOperator = null, + + global::System.Action>? queryFilterVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsComparisonOperator) + { + comparisonOperator?.Invoke(ComparisonOperator!); + } + else if (IsLogicalOperator) + { + logicalOperator?.Invoke(LogicalOperator!); + } + else if (IsQueryFilterVariant3) + { + queryFilterVariant3?.Invoke(QueryFilterVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? comparisonOperator = null, + global::System.Action>>? logicalOperator = null, + global::System.Action>? queryFilterVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs index 57f38c74..4774be4b 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs @@ -14,5 +14,6 @@ public sealed partial class QueryFilterVariant3 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs b/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs index 089b8de3..6679c641 100644 --- a/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs @@ -65,5 +65,6 @@ public RFIResponseSection( public RFIResponseSection() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs index 7a087b43..81145fcc 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs @@ -50,5 +50,6 @@ public RequirementItem( public RequirementItem() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs index 7e939090..2b890a77 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs @@ -40,5 +40,6 @@ public RequirementsGenerationRequest( public RequirementsGenerationRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs index 3e3453b1..357d696d 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs @@ -40,5 +40,6 @@ public RequirementsGenerationResponse( public RequirementsGenerationResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs index 7a9454d7..bbe9bdd9 100644 --- a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs @@ -41,5 +41,6 @@ public ResponseFormat( public ResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs index af5ee6a1..5f88af79 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs @@ -114,5 +114,6 @@ public RunAssistantRequest( public RunAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs index daf4d4c5..105a51e4 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs @@ -14,5 +14,6 @@ public sealed partial class RunAssistantRequestOutputType /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.g.cs index 15d25a61..2556d3a5 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSy /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.g.cs index 72e5c73b..f856b6c0 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdD /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs index 77f35419..08e10800 100644 --- a/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs @@ -50,5 +50,6 @@ public SecretResponse( public SecretResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs b/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs index 30e98383..45a011da 100644 --- a/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs @@ -50,5 +50,6 @@ public StarterQuestion( public StarterQuestion() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.g.cs index be803e64..122d794f 100644 --- a/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncP /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs index bdb3985c..bb7b7eae 100644 --- a/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs @@ -72,5 +72,6 @@ public SystemMessage( public SystemMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.g.cs index 52b5208d..e03955ed 100644 --- a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.g.cs @@ -40,5 +40,6 @@ public ThreadNameGenerationRequest( public ThreadNameGenerationRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.g.cs index c1b33850..eeb770c3 100644 --- a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.g.cs @@ -40,5 +40,6 @@ public ThreadNameGenerationResponse( public ThreadNameGenerationResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.Json.g.cs deleted file mode 100644 index 55e40dc8..00000000 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse), - jsonSerializerContext) as global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.g.cs deleted file mode 100644 index 030fe94c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs index 44bf3bc9..778932cc 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs @@ -68,5 +68,6 @@ public ToolCall( public ToolCall() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs index 9acdb18c..523be694 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs @@ -50,5 +50,6 @@ public ToolCallDelta( public ToolCallDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs index 65a508b6..e4cbc4d0 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs @@ -76,5 +76,6 @@ public ToolCallDeltaStart( public ToolCallDeltaStart() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs index afffd7d0..f5a88410 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs @@ -50,5 +50,6 @@ public ToolFunction( public ToolFunction() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs index b008c415..746cc7f2 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs @@ -40,5 +40,6 @@ public ToolFunctionDelta( public ToolFunctionDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs index 3cfb2e3a..2c5275bd 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs @@ -40,5 +40,6 @@ public ToolFunctionDeltaStart( public ToolFunctionDeltaStart() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs index ed8d4674..8dad1229 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs @@ -82,5 +82,6 @@ public ToolMessage( public ToolMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs index 1b7ceb65..137b6ef1 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs @@ -65,5 +65,6 @@ public ToolParameters( public ToolParameters() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs index f54f4a8b..846ba28a 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs @@ -14,5 +14,6 @@ public sealed partial class ToolParametersProperties /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs index d0fcc7b7..94eabc97 100644 --- a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs @@ -50,5 +50,6 @@ public TopLogprobsData( public TopLogprobsData() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs index fd3ce16e..1e5ce2a9 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs @@ -40,5 +40,6 @@ public UpdateMCPStorageRequest( public UpdateMCPStorageRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs index 7236cd81..6228016b 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs @@ -49,5 +49,6 @@ public UpdateRoutePayload( public UpdateRoutePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs index 8ef2aa9a..0d1eb016 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs @@ -48,5 +48,6 @@ public UpdateSecretPayload( public UpdateSecretPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs index 6d1f4406..a86288e8 100644 --- a/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class UploadCheckComplianceStudioV1DemosRegulationsUploadC /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs b/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs index 9564ff2a..2519b267 100644 --- a/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs @@ -74,5 +74,6 @@ public UsageInfo( public UsageInfo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs index 757a6fb3..05bd0669 100644 --- a/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs @@ -72,5 +72,6 @@ public UserMessage( public UserMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs index 5122ed8e..4d42121f 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1DeleteRouteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs index cbb3266d..b6db2e95 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs index d72131cb..8f7c517c 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryManagementResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs index 9b410ac6..f8d5fb07 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryManagementResponse2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs index 0e52df15..bf7f2a3b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryManagementResponse3 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.g.cs index efe60bb3..7846d563 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibrarySearchResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs index bdf07feb..bd313897 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryUploadResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs index 09de51fa..1aedc71a 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs index ea33992a..112cb2f5 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs index 22edf9be..7fbda9c9 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse3 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs index 04e05912..bc52ebc6 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse4 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotyProductLookupResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotyProductLookupResponse.Json.g.cs new file mode 100644 index 00000000..4f68eaf4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotyProductLookupResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsClarotyProductLookupResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsClarotyProductLookupResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsClarotyProductLookupResponse), + jsonSerializerContext) as global::AI21.V1SolutionsClarotyProductLookupResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsClarotyProductLookupResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsClarotyProductLookupResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsClarotyProductLookupResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotyProductLookupResponse.g.cs similarity index 86% rename from src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotyProductLookupResponse.g.cs index a78920d4..b445cfa8 100644 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotyProductLookupResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class WppFeedbackSolutionsWppFeedbackPostResponse + public sealed partial class V1SolutionsClarotyProductLookupResponse { /// @@ -14,5 +14,6 @@ public sealed partial class WppFeedbackSolutionsWppFeedbackPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.Json.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.Json.g.cs index c2ada3e0..ca005469 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaSourcesSolutionsVidaaSourcesGetResponse + public sealed partial class V1SolutionsClarotySuggestVendorModelResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse? FromJson( + public static global::AI21.V1SolutionsClarotySuggestVendorModelResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse), - jsonSerializerContext) as global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse; + typeof(global::AI21.V1SolutionsClarotySuggestVendorModelResponse), + jsonSerializerContext) as global::AI21.V1SolutionsClarotySuggestVendorModelResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse? FromJson( + public static global::AI21.V1SolutionsClarotySuggestVendorModelResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse; + typeof(global::AI21.V1SolutionsClarotySuggestVendorModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsClarotySuggestVendorModelResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.g.cs index 1642222c..0a10e546 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse + public sealed partial class V1SolutionsClarotySuggestVendorModelResponse { /// @@ -14,5 +14,6 @@ public sealed partial class VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..42cb4523 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..66b7a803 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.Json.g.cs new file mode 100644 index 00000000..2835cf1d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResultsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs index 70f13984..47413b66 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaActionItemsSolutionsVidaaActionItemsPostResponse + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResultsResponse { /// @@ -14,5 +14,6 @@ public sealed partial class VidaaActionItemsSolutionsVidaaActionItemsPostRespons /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.Json.g.cs new file mode 100644 index 00000000..657da199 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1ClassificationsStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.g.cs new file mode 100644 index 00000000..ed3c6e3e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1ClassificationsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..248b8bd4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs index e0251fe7..6bc28396 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaSourcesSolutionsVidaaSourcesGetResponse + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResponse { /// @@ -14,5 +14,6 @@ public sealed partial class VidaaSourcesSolutionsVidaaSourcesGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.Json.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.Json.g.cs index a0602328..1f744163 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaSummarizeSolutionsVidaaSummarizePostResponse + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResultsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse? FromJson( + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse), - jsonSerializerContext) as global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse; + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse? FromJson( + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse; + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs index d5e69cc1..6d0252c7 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaMessagesSolutionsVidaaApiMessagesPostResponse + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResultsResponse { /// @@ -14,5 +14,6 @@ public sealed partial class VidaaMessagesSolutionsVidaaApiMessagesPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.Json.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.Json.g.cs index 53977f30..cd98b0cd 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse + public sealed partial class V1SolutionsFdBatchesV1DescriptionsStatusResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse? FromJson( + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse), - jsonSerializerContext) as global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse; + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse? FromJson( + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse; + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs index 842d6404..dceb7d9e 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaSummarizeSolutionsVidaaSummarizePostResponse + public sealed partial class V1SolutionsFdBatchesV1DescriptionsStatusResponse { /// @@ -14,5 +14,6 @@ public sealed partial class VidaaSummarizeSolutionsVidaaSummarizePostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..4969375f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs index 4563db0f..13e4075b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResponse { /// @@ -14,5 +14,6 @@ public sealed partial class ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostRespons /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.Json.g.cs similarity index 81% rename from src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.Json.g.cs index 57676eb9..fc5ba55f 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse), - jsonSerializerContext) as global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs new file mode 100644 index 00000000..3e2ca3f0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.Json.g.cs similarity index 81% rename from src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.Json.g.cs index f1e7db42..f58f2588 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs index bee31302..895cb0b9 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse { /// @@ -14,5 +14,6 @@ public sealed partial class KirshEmailAssistantSolutionsKirshEmailAssistantPostR /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.Json.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.Json.g.cs index 4032fcab..ebc76a9c 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaSubscribeSolutionsVidaaSubscribePostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs new file mode 100644 index 00000000..f6ae248d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.Json.g.cs similarity index 82% rename from src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.Json.g.cs index 8bd27f7c..8fa9b311 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse? FromJson( + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse; + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs index 49d38b3b..443992d4 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse { /// @@ -14,5 +14,6 @@ public sealed partial class KirshGrantMetadataSolutionsKirshGrantMetadataPostRes /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.Json.g.cs new file mode 100644 index 00000000..28423677 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.g.cs new file mode 100644 index 00000000..dcbcbd33 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.Json.g.cs new file mode 100644 index 00000000..251d80bf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacAftersalesBatchPredictResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.g.cs new file mode 100644 index 00000000..a93ff3ef --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesBatchPredictResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.Json.g.cs new file mode 100644 index 00000000..db994712 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacAftersalesBatchPredictStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.g.cs new file mode 100644 index 00000000..2150af47 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesBatchPredictStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.Json.g.cs new file mode 100644 index 00000000..309513d1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs index cbc6d9bf..5be7243a 100644 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class TlvConvragSolutionsTlvMunicipalityConvragPostResponse + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictResponse { /// @@ -14,5 +14,6 @@ public sealed partial class TlvConvragSolutionsTlvMunicipalityConvragPostRespons /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.Json.g.cs similarity index 81% rename from src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.Json.g.cs index ea3a6824..10352bb6 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse? FromJson( + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse), - jsonSerializerContext) as global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse; + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse? FromJson( + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse; + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.g.cs new file mode 100644 index 00000000..b169cdde --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..d0091b80 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacPreviewV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..70b0b2e8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacPreviewV1ClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.Json.g.cs similarity index 81% rename from src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.Json.g.cs index 3c297edc..c9b93e50 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse? FromJson( + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse; + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse? FromJson( + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse; + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs index 62c6c675..224273ff 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse { /// @@ -14,5 +14,6 @@ public sealed partial class FnacV1DescriptionsSolutionsFnacV1DescriptionsPostRes /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..fab51d3e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.g.cs new file mode 100644 index 00000000..90cc82b5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..9a80ca07 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacPreviewV1DescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.g.cs new file mode 100644 index 00000000..e42d912a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacPreviewV1DescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..741f2b48 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..3d102467 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacV1ClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.Json.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.Json.g.cs index 6e68a58d..765b0159 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaMessagesSolutionsVidaaApiMessagesPostResponse + public sealed partial class V1SolutionsFnacV1DeprecatedClassificationsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse? FromJson( + public static global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse), - jsonSerializerContext) as global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse; + typeof(global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse? FromJson( + public static global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse; + typeof(global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs new file mode 100644 index 00000000..949ca610 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacV1DeprecatedClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..d372ce55 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacV1DeprecatedDescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.g.cs new file mode 100644 index 00000000..4cdf9130 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacV1DeprecatedDescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.Json.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.Json.g.cs index c2aa8675..4eb52056 100644 --- a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class WppQuerySolutionsWppQueryPostResponse + public sealed partial class V1SolutionsFnacV1DescriptionsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.WppQuerySolutionsWppQueryPostResponse? FromJson( + public static global::AI21.V1SolutionsFnacV1DescriptionsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.WppQuerySolutionsWppQueryPostResponse), - jsonSerializerContext) as global::AI21.WppQuerySolutionsWppQueryPostResponse; + typeof(global::AI21.V1SolutionsFnacV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1DescriptionsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.WppQuerySolutionsWppQueryPostResponse? FromJson( + public static global::AI21.V1SolutionsFnacV1DescriptionsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.WppQuerySolutionsWppQueryPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppQuerySolutionsWppQueryPostResponse; + typeof(global::AI21.V1SolutionsFnacV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1DescriptionsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.g.cs similarity index 88% rename from src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.g.cs index 242d3673..aeae35c9 100644 --- a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class WppQuerySolutionsWppQueryPostResponse + public sealed partial class V1SolutionsFnacV1DescriptionsResponse { /// @@ -14,5 +14,6 @@ public sealed partial class WppQuerySolutionsWppQueryPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshDocumentUploadProcessResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshDocumentUploadProcessResponse.Json.g.cs new file mode 100644 index 00000000..7395bfbd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshDocumentUploadProcessResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshDocumentUploadProcessResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshDocumentUploadProcessResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshDocumentUploadProcessResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshDocumentUploadProcessResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshDocumentUploadProcessResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshDocumentUploadProcessResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshDocumentUploadProcessResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshDocumentUploadProcessResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshDocumentUploadProcessResponse.g.cs new file mode 100644 index 00000000..c21aea58 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshDocumentUploadProcessResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshDocumentUploadProcessResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshEmailAssistantResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshEmailAssistantResponse.Json.g.cs new file mode 100644 index 00000000..275f390a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshEmailAssistantResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshEmailAssistantResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshEmailAssistantResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshEmailAssistantResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshEmailAssistantResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshEmailAssistantResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshEmailAssistantResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshEmailAssistantResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshEmailAssistantResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshEmailAssistantResponse.g.cs new file mode 100644 index 00000000..41848daa --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshEmailAssistantResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshEmailAssistantResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.Json.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.Json.g.cs index caa4ba89..c71a1268 100644 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class TlvConvragSolutionsTlvMunicipalityConvragPostResponse + public sealed partial class V1SolutionsKirshFundingAndCategorizationCheckResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse? FromJson( + public static global::AI21.V1SolutionsKirshFundingAndCategorizationCheckResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse), - jsonSerializerContext) as global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse; + typeof(global::AI21.V1SolutionsKirshFundingAndCategorizationCheckResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshFundingAndCategorizationCheckResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse? FromJson( + public static global::AI21.V1SolutionsKirshFundingAndCategorizationCheckResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse; + typeof(global::AI21.V1SolutionsKirshFundingAndCategorizationCheckResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshFundingAndCategorizationCheckResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.g.cs new file mode 100644 index 00000000..af84ce2a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshFundingAndCategorizationCheckResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantComplianceResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantComplianceResponse.Json.g.cs new file mode 100644 index 00000000..f06afd6d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantComplianceResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshGrantComplianceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshGrantComplianceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshGrantComplianceResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshGrantComplianceResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshGrantComplianceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshGrantComplianceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshGrantComplianceResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantComplianceResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantComplianceResponse.g.cs new file mode 100644 index 00000000..da6b9521 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantComplianceResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshGrantComplianceResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantMetadataResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantMetadataResponse.Json.g.cs new file mode 100644 index 00000000..f96c0afb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantMetadataResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshGrantMetadataResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshGrantMetadataResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshGrantMetadataResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshGrantMetadataResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshGrantMetadataResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshGrantMetadataResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshGrantMetadataResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantMetadataResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantMetadataResponse.g.cs new file mode 100644 index 00000000..e5958014 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantMetadataResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshGrantMetadataResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewDocumentUploadProcessResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewDocumentUploadProcessResponse.Json.g.cs new file mode 100644 index 00000000..8f64e86f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewDocumentUploadProcessResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshPreviewDocumentUploadProcessResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshPreviewDocumentUploadProcessResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshPreviewDocumentUploadProcessResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshPreviewDocumentUploadProcessResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshPreviewDocumentUploadProcessResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshPreviewDocumentUploadProcessResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshPreviewDocumentUploadProcessResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewDocumentUploadProcessResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewDocumentUploadProcessResponse.g.cs new file mode 100644 index 00000000..1e6f1b03 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewDocumentUploadProcessResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshPreviewDocumentUploadProcessResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewEmailAssistantResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewEmailAssistantResponse.Json.g.cs new file mode 100644 index 00000000..be98de4b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewEmailAssistantResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshPreviewEmailAssistantResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshPreviewEmailAssistantResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshPreviewEmailAssistantResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshPreviewEmailAssistantResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshPreviewEmailAssistantResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshPreviewEmailAssistantResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshPreviewEmailAssistantResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewEmailAssistantResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewEmailAssistantResponse.g.cs new file mode 100644 index 00000000..6ee1c0b7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewEmailAssistantResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshPreviewEmailAssistantResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.Json.g.cs similarity index 80% rename from src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.Json.g.cs index ec607a48..32a783ec 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse + public sealed partial class V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse? FromJson( + public static global::AI21.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse), - jsonSerializerContext) as global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse; + typeof(global::AI21.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse? FromJson( + public static global::AI21.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse; + typeof(global::AI21.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.g.cs index 214d2ea1..535b87d7 100644 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class ClarotyProductLookupSolutionsClarotyProductLookupPostResponse + public sealed partial class V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse { /// @@ -14,5 +14,6 @@ public sealed partial class ClarotyProductLookupSolutionsClarotyProductLookupPos /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantComplianceResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantComplianceResponse.Json.g.cs new file mode 100644 index 00000000..99fa2bd9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantComplianceResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshPreviewGrantComplianceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshPreviewGrantComplianceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshPreviewGrantComplianceResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshPreviewGrantComplianceResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshPreviewGrantComplianceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshPreviewGrantComplianceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshPreviewGrantComplianceResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantComplianceResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantComplianceResponse.g.cs new file mode 100644 index 00000000..bafb53de --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantComplianceResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshPreviewGrantComplianceResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantMetadataResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantMetadataResponse.Json.g.cs new file mode 100644 index 00000000..92bb57df --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantMetadataResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshPreviewGrantMetadataResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshPreviewGrantMetadataResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshPreviewGrantMetadataResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshPreviewGrantMetadataResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshPreviewGrantMetadataResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshPreviewGrantMetadataResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshPreviewGrantMetadataResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantMetadataResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantMetadataResponse.g.cs new file mode 100644 index 00000000..5776e41e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantMetadataResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshPreviewGrantMetadataResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.Json.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.Json.g.cs index 197cbae5..145152e7 100644 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse + public sealed partial class V1SolutionsKirshPreviewPublicInformationCheckResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse? FromJson( + public static global::AI21.V1SolutionsKirshPreviewPublicInformationCheckResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse), - jsonSerializerContext) as global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse; + typeof(global::AI21.V1SolutionsKirshPreviewPublicInformationCheckResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshPreviewPublicInformationCheckResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse? FromJson( + public static global::AI21.V1SolutionsKirshPreviewPublicInformationCheckResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse; + typeof(global::AI21.V1SolutionsKirshPreviewPublicInformationCheckResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshPreviewPublicInformationCheckResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.g.cs new file mode 100644 index 00000000..61d8b2d8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshPreviewPublicInformationCheckResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPublicInformationCheckResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPublicInformationCheckResponse.Json.g.cs new file mode 100644 index 00000000..6d910d15 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPublicInformationCheckResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsKirshPublicInformationCheckResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsKirshPublicInformationCheckResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsKirshPublicInformationCheckResponse), + jsonSerializerContext) as global::AI21.V1SolutionsKirshPublicInformationCheckResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsKirshPublicInformationCheckResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsKirshPublicInformationCheckResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsKirshPublicInformationCheckResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPublicInformationCheckResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPublicInformationCheckResponse.g.cs new file mode 100644 index 00000000..4563652a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPublicInformationCheckResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshPublicInformationCheckResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.Json.g.cs new file mode 100644 index 00000000..5b950019 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsTlvMunicipalityConvragResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsTlvMunicipalityConvragResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsTlvMunicipalityConvragResponse), + jsonSerializerContext) as global::AI21.V1SolutionsTlvMunicipalityConvragResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsTlvMunicipalityConvragResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsTlvMunicipalityConvragResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsTlvMunicipalityConvragResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.g.cs new file mode 100644 index 00000000..5a09bcde --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsTlvMunicipalityConvragResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.Json.g.cs new file mode 100644 index 00000000..a0888a69 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsTlvMunicipalityPreviewConvragResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse), + jsonSerializerContext) as global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs index 1972ba86..45ea9ef6 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaSubscribeSolutionsVidaaSubscribePostResponse + public sealed partial class V1SolutionsTlvMunicipalityPreviewConvragResponse { /// @@ -14,5 +14,6 @@ public sealed partial class VidaaSubscribeSolutionsVidaaSubscribePostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaActionItemsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaActionItemsResponse.Json.g.cs new file mode 100644 index 00000000..61b2e2d1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaActionItemsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaActionItemsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaActionItemsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaActionItemsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaActionItemsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaActionItemsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaActionItemsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaActionItemsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaActionItemsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaActionItemsResponse.g.cs new file mode 100644 index 00000000..af1b152b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaActionItemsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaActionItemsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaApiMessagesResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaApiMessagesResponse.Json.g.cs new file mode 100644 index 00000000..3b0bf4f9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaApiMessagesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaApiMessagesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaApiMessagesResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaApiMessagesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaApiMessagesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaApiMessagesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaApiMessagesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaApiMessagesResponse.g.cs new file mode 100644 index 00000000..9676bc9a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaApiMessagesResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaApiMessagesResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentApiMessagesResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentApiMessagesResponse.Json.g.cs new file mode 100644 index 00000000..0b2ed94b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentApiMessagesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentApiMessagesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentApiMessagesResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentApiMessagesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentApiMessagesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentApiMessagesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentApiMessagesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentApiMessagesResponse.g.cs new file mode 100644 index 00000000..ed265691 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentApiMessagesResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentApiMessagesResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsResponse.Json.g.cs new file mode 100644 index 00000000..55333452 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentBriefJobsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentBriefJobsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentBriefJobsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentBriefJobsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentBriefJobsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentBriefJobsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentBriefJobsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsResponse.g.cs new file mode 100644 index 00000000..fdf1665a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentBriefJobsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsStatusResponse.Json.g.cs new file mode 100644 index 00000000..0bfbcd80 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsStatusResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentBriefJobsStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentBriefJobsStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentBriefJobsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentBriefJobsStatusResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentBriefJobsStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentBriefJobsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentBriefJobsStatusResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsStatusResponse.g.cs new file mode 100644 index 00000000..b8b418ba --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentBriefJobsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefResponse.Json.g.cs new file mode 100644 index 00000000..ccd41f59 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentBriefResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentBriefResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentBriefResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentBriefResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentBriefResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentBriefResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentBriefResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefResponse.g.cs new file mode 100644 index 00000000..40335eba --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentBriefResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefScheduledResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefScheduledResponse.Json.g.cs new file mode 100644 index 00000000..3c353e93 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefScheduledResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentBriefScheduledResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentBriefScheduledResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentBriefScheduledResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentBriefScheduledResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentBriefScheduledResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentBriefScheduledResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentBriefScheduledResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefScheduledResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefScheduledResponse.g.cs new file mode 100644 index 00000000..c60d6ea9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefScheduledResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentBriefScheduledResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscribeResponse.Json.g.cs new file mode 100644 index 00000000..07d69678 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentSubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentSubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentSubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentSubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentSubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentSubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentSubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscribeResponse.g.cs new file mode 100644 index 00000000..4f21ed85 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentSubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscriptionsResponse.Json.g.cs new file mode 100644 index 00000000..aee943fe --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentSubscriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentSubscriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentSubscriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentSubscriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentSubscriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscriptionsResponse.g.cs new file mode 100644 index 00000000..c12506c9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentSubscriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentUnsubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentUnsubscribeResponse.Json.g.cs new file mode 100644 index 00000000..a8b1b6e0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentUnsubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaContentUnsubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaContentUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaContentUnsubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaContentUnsubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaContentUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaContentUnsubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaContentUnsubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentUnsubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentUnsubscribeResponse.g.cs new file mode 100644 index 00000000..c12a4787 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentUnsubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaContentUnsubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaFeedItemsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaFeedItemsResponse.Json.g.cs new file mode 100644 index 00000000..1825a659 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaFeedItemsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaFeedItemsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaFeedItemsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaFeedItemsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaFeedItemsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaFeedItemsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaFeedItemsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaFeedItemsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaFeedItemsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaFeedItemsResponse.g.cs new file mode 100644 index 00000000..8d61cd91 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaFeedItemsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaFeedItemsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewActionItemsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewActionItemsResponse.Json.g.cs new file mode 100644 index 00000000..f8ea0845 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewActionItemsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewActionItemsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewActionItemsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewActionItemsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewActionItemsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewActionItemsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewActionItemsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewActionItemsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewActionItemsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewActionItemsResponse.g.cs new file mode 100644 index 00000000..d2d498dd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewActionItemsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewActionItemsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewApiMessagesResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewApiMessagesResponse.Json.g.cs new file mode 100644 index 00000000..d617a165 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewApiMessagesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewApiMessagesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewApiMessagesResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewApiMessagesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewApiMessagesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewApiMessagesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewApiMessagesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewApiMessagesResponse.g.cs new file mode 100644 index 00000000..4ed1e1ac --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewApiMessagesResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewApiMessagesResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentApiMessagesResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentApiMessagesResponse.Json.g.cs new file mode 100644 index 00000000..72b0cad4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentApiMessagesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewContentApiMessagesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewContentApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewContentApiMessagesResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentApiMessagesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewContentApiMessagesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewContentApiMessagesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentApiMessagesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentApiMessagesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentApiMessagesResponse.g.cs new file mode 100644 index 00000000..5e8931a0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentApiMessagesResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentApiMessagesResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsResponse.Json.g.cs new file mode 100644 index 00000000..b1ebbcca --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewContentBriefJobsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewContentBriefJobsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefJobsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentBriefJobsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewContentBriefJobsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefJobsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentBriefJobsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsResponse.g.cs new file mode 100644 index 00000000..f5f12443 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentBriefJobsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.Json.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.Json.g.cs index a1099391..27031203 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class VidaaActionItemsSolutionsVidaaActionItemsPostResponse + public sealed partial class V1SolutionsVidaaPreviewContentBriefJobsStatusResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse? FromJson( + public static global::AI21.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse), - jsonSerializerContext) as global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse; + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse? FromJson( + public static global::AI21.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse; + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.g.cs new file mode 100644 index 00000000..d821a98a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentBriefJobsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefResponse.Json.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.Json.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefResponse.Json.g.cs index c6afe9d4..e0b6cb0f 100644 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace AI21 { - public sealed partial class WppFeedbackSolutionsWppFeedbackPostResponse + public sealed partial class V1SolutionsVidaaPreviewContentBriefResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse? FromJson( + public static global::AI21.V1SolutionsVidaaPreviewContentBriefResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse), - jsonSerializerContext) as global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse; + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentBriefResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse? FromJson( + public static global::AI21.V1SolutionsVidaaPreviewContentBriefResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse; + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentBriefResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefResponse.g.cs new file mode 100644 index 00000000..cd92e207 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentBriefResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefScheduledResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefScheduledResponse.Json.g.cs new file mode 100644 index 00000000..140041f6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefScheduledResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewContentBriefScheduledResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewContentBriefScheduledResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefScheduledResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentBriefScheduledResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewContentBriefScheduledResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewContentBriefScheduledResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentBriefScheduledResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefScheduledResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefScheduledResponse.g.cs new file mode 100644 index 00000000..176e926a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefScheduledResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentBriefScheduledResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscribeResponse.Json.g.cs new file mode 100644 index 00000000..93199465 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewContentSubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewContentSubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewContentSubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentSubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewContentSubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewContentSubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentSubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscribeResponse.g.cs new file mode 100644 index 00000000..9ee28732 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentSubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscriptionsResponse.Json.g.cs new file mode 100644 index 00000000..4d6b7a61 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewContentSubscriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewContentSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewContentSubscriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentSubscriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewContentSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewContentSubscriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentSubscriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscriptionsResponse.g.cs new file mode 100644 index 00000000..55e7d651 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentSubscriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentUnsubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentUnsubscribeResponse.Json.g.cs new file mode 100644 index 00000000..fff7a03d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentUnsubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewContentUnsubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewContentUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewContentUnsubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewContentUnsubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewContentUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewContentUnsubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewContentUnsubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentUnsubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentUnsubscribeResponse.g.cs new file mode 100644 index 00000000..ae847f97 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentUnsubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewContentUnsubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewFeedItemsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewFeedItemsResponse.Json.g.cs new file mode 100644 index 00000000..72284d91 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewFeedItemsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewFeedItemsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewFeedItemsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewFeedItemsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewFeedItemsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewFeedItemsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewFeedItemsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewFeedItemsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewFeedItemsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewFeedItemsResponse.g.cs new file mode 100644 index 00000000..86d689dd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewFeedItemsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewFeedItemsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSchedulerStatsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSchedulerStatsResponse.Json.g.cs new file mode 100644 index 00000000..336ab9c3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSchedulerStatsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewSchedulerStatsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewSchedulerStatsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewSchedulerStatsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewSchedulerStatsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewSchedulerStatsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewSchedulerStatsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewSchedulerStatsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSchedulerStatsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSchedulerStatsResponse.g.cs new file mode 100644 index 00000000..0f60a941 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSchedulerStatsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewSchedulerStatsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSourcesResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSourcesResponse.Json.g.cs new file mode 100644 index 00000000..480abd73 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSourcesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewSourcesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewSourcesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewSourcesResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewSourcesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewSourcesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewSourcesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewSourcesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSourcesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSourcesResponse.g.cs new file mode 100644 index 00000000..a901cfd3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSourcesResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewSourcesResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscribeResponse.Json.g.cs new file mode 100644 index 00000000..3b68e555 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewSubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewSubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewSubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewSubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewSubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewSubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewSubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscribeResponse.g.cs new file mode 100644 index 00000000..7b65edc1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewSubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscriptionsResponse.Json.g.cs new file mode 100644 index 00000000..a53c6ed8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewSubscriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewSubscriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewSubscriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewSubscriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewSubscriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscriptionsResponse.g.cs new file mode 100644 index 00000000..ba061cf8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewSubscriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSummarizeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSummarizeResponse.Json.g.cs new file mode 100644 index 00000000..5cdefdf7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSummarizeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewSummarizeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewSummarizeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewSummarizeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewSummarizeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewSummarizeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewSummarizeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewSummarizeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSummarizeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSummarizeResponse.g.cs new file mode 100644 index 00000000..56816ea6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSummarizeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewSummarizeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewTriggerPollResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewTriggerPollResponse.Json.g.cs new file mode 100644 index 00000000..45ddea2e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewTriggerPollResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewTriggerPollResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewTriggerPollResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewTriggerPollResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewTriggerPollResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewTriggerPollResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewTriggerPollResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewTriggerPollResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewTriggerPollResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewTriggerPollResponse.g.cs new file mode 100644 index 00000000..2d00ebd5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewTriggerPollResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewTriggerPollResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewUnsubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewUnsubscribeResponse.Json.g.cs new file mode 100644 index 00000000..e21a35ac --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewUnsubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaPreviewUnsubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaPreviewUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaPreviewUnsubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaPreviewUnsubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaPreviewUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaPreviewUnsubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaPreviewUnsubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewUnsubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewUnsubscribeResponse.g.cs new file mode 100644 index 00000000..1c5ee560 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewUnsubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaPreviewUnsubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSchedulerStatsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSchedulerStatsResponse.Json.g.cs new file mode 100644 index 00000000..be507c7d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSchedulerStatsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaSchedulerStatsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaSchedulerStatsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaSchedulerStatsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaSchedulerStatsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaSchedulerStatsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaSchedulerStatsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaSchedulerStatsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSchedulerStatsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSchedulerStatsResponse.g.cs new file mode 100644 index 00000000..602894f0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSchedulerStatsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaSchedulerStatsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSourcesResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSourcesResponse.Json.g.cs new file mode 100644 index 00000000..a6a79fb2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSourcesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaSourcesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaSourcesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaSourcesResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaSourcesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaSourcesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaSourcesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaSourcesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSourcesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSourcesResponse.g.cs new file mode 100644 index 00000000..35d902b2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSourcesResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaSourcesResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscribeResponse.Json.g.cs new file mode 100644 index 00000000..791dadd5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaSubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaSubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaSubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaSubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaSubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaSubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaSubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscribeResponse.g.cs new file mode 100644 index 00000000..73f3d15b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaSubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscriptionsResponse.Json.g.cs new file mode 100644 index 00000000..97106034 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscriptionsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaSubscriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaSubscriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaSubscriptionsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaSubscriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaSubscriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaSubscriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscriptionsResponse.g.cs new file mode 100644 index 00000000..dea98795 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaSubscriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSummarizeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSummarizeResponse.Json.g.cs new file mode 100644 index 00000000..97ba8c9c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSummarizeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaSummarizeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaSummarizeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaSummarizeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaSummarizeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaSummarizeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaSummarizeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaSummarizeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSummarizeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSummarizeResponse.g.cs new file mode 100644 index 00000000..908e637c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSummarizeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaSummarizeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaTriggerPollResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaTriggerPollResponse.Json.g.cs new file mode 100644 index 00000000..ab702f90 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaTriggerPollResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaTriggerPollResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaTriggerPollResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaTriggerPollResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaTriggerPollResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaTriggerPollResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaTriggerPollResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaTriggerPollResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaTriggerPollResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaTriggerPollResponse.g.cs new file mode 100644 index 00000000..d9a9b036 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaTriggerPollResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaTriggerPollResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaUnsubscribeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaUnsubscribeResponse.Json.g.cs new file mode 100644 index 00000000..fae45f60 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaUnsubscribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsVidaaUnsubscribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsVidaaUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsVidaaUnsubscribeResponse), + jsonSerializerContext) as global::AI21.V1SolutionsVidaaUnsubscribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsVidaaUnsubscribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsVidaaUnsubscribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsVidaaUnsubscribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaUnsubscribeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaUnsubscribeResponse.g.cs new file mode 100644 index 00000000..ac9309a1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaUnsubscribeResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsVidaaUnsubscribeResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs index d91072c2..c9555416 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorCreateConfigResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs index 444637ca..78f48e1d 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorGetConfigResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs index 21407efc..b21a3712 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorGetUrlStatusResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs index 4f270331..d2a58c40 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorGetWebsiteStatusResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs index 33eab8d9..41362f0e 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorIngestUrlResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs index eb568daa..7d41b843 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorIngestWebsiteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs index 75a965b5..8b25a97a 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorRetryIngestWebsiteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs index b3a10b2f..47bb0a89 100644 --- a/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs @@ -60,5 +60,6 @@ public ValidationError( public ValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs index f1b7f792..57d4b602 100644 --- a/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs @@ -58,5 +58,6 @@ public ValidationResult( public ValidationResult() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.Json.g.cs deleted file mode 100644 index 02e81116..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse), - jsonSerializerContext) as global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.g.cs deleted file mode 100644 index 4d4dd41f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.Json.g.cs deleted file mode 100644 index 57dba20f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse), - jsonSerializerContext) as global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.g.cs deleted file mode 100644 index b95737c7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.Json.g.cs deleted file mode 100644 index a54e8b07..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse), - jsonSerializerContext) as global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.g.cs deleted file mode 100644 index 635f9ae1..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.Json.g.cs deleted file mode 100644 index 9e1eddf4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.g.cs deleted file mode 100644 index 269e23a2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.g.cs deleted file mode 100644 index 093d4f86..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.g.cs deleted file mode 100644 index e19550d4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.Json.g.cs deleted file mode 100644 index 849dbb9e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.g.cs deleted file mode 100644 index 85645ec6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.Json.g.cs deleted file mode 100644 index 3defca0e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.g.cs deleted file mode 100644 index 0fb2faa7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.g.cs deleted file mode 100644 index 86ddccc3..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.Json.g.cs deleted file mode 100644 index 0ff2fcfd..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse), - jsonSerializerContext) as global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.g.cs deleted file mode 100644 index 21fbf236..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.Json.g.cs deleted file mode 100644 index 6380dfef..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse), - jsonSerializerContext) as global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.g.cs deleted file mode 100644 index 4f530dda..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.Json.g.cs deleted file mode 100644 index e21c0058..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse), - jsonSerializerContext) as global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.g.cs deleted file mode 100644 index 328936b4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.Json.g.cs deleted file mode 100644 index f8521a70..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.g.cs deleted file mode 100644 index ac570269..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.Json.g.cs deleted file mode 100644 index 742a47db..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.g.cs deleted file mode 100644 index 0d8f1955..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs index 3ccfbbc2..f816e6bf 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs @@ -89,5 +89,6 @@ public WebSearchToolResource( public WebSearchToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs index 23ba6c18..76370a14 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs @@ -91,5 +91,6 @@ public WebsiteConnectorCreateConfigPayload( public WebsiteConnectorCreateConfigPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs index 143e232b..26519c24 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs @@ -40,5 +40,6 @@ public WebsiteConnectorIngestUrlPayload( public WebsiteConnectorIngestUrlPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs index 0d9ae054..8f3a6272 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs @@ -58,5 +58,6 @@ public WebsiteConnectorIngestWebsitePayload( public WebsiteConnectorIngestWebsitePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.g.cs index b5b09b47..ea1e1703 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.g.cs @@ -52,5 +52,6 @@ public WebsiteConnectorPayload( public WebsiteConnectorPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs index 2bf2e81a..02398088 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs @@ -40,5 +40,6 @@ public WebsiteConnectorRetryIngestWebsitePayload( public WebsiteConnectorRetryIngestWebsitePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs index faf3567e..cc63461a 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs @@ -58,5 +58,6 @@ public WorkflowConfig( public WorkflowConfig() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs index e6f253a8..9b3865f5 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs @@ -14,5 +14,6 @@ public sealed partial class WorkflowConfigAdditionalParams /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs index cc242094..0180bcb5 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs @@ -14,5 +14,6 @@ public sealed partial class WorkflowConfigHeaders /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs index a876cff5..1edc1c35 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs @@ -97,5 +97,6 @@ public WorkspaceModelResponse( public WorkspaceModelResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs index 5eaa9a9e..8cdcdbca 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs @@ -57,5 +57,6 @@ public WorkspaceModelUpdate( public WorkspaceModelUpdate() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs index 6b57dd64..d41946e7 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs @@ -40,5 +40,6 @@ public WorkspaceModelsResponse( public WorkspaceModelsResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.Json.g.cs deleted file mode 100644 index 5bd639c7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse), - jsonSerializerContext) as global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.g.cs deleted file mode 100644 index 3f8cb5f6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.Json.g.cs deleted file mode 100644 index c1f3f1ea..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse), - jsonSerializerContext) as global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.g.cs deleted file mode 100644 index f5bb126f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.OptionsSupport.g.cs b/src/libs/AI21/Generated/AI21.OptionsSupport.g.cs new file mode 100644 index 00000000..30dcc959 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.OptionsSupport.g.cs @@ -0,0 +1,937 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Global defaults applied to generated SDK requests. + /// + public sealed class AutoSDKClientOptions + { + /// + /// Additional headers applied to every request after generated headers are set. + /// Entries with the same key overwrite earlier header values. + /// + public global::System.Collections.Generic.Dictionary Headers { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.OrdinalIgnoreCase); + + /// + /// Additional query parameters appended to every request. + /// Request-level entries with the same key are appended after client defaults. + /// + public global::System.Collections.Generic.Dictionary QueryParameters { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.Ordinal); + + /// + /// Optional timeout applied to the full request execution. + /// + public global::System.TimeSpan? Timeout { get; set; } + + /// + /// Default retry behavior for generated HTTP requests. + /// + public global::AI21.AutoSDKRetryOptions Retry { get; set; } = new global::AI21.AutoSDKRetryOptions(); + + /// + /// Overrides the client-wide response buffering mode when set. + /// + public bool? ReadResponseAsString { get; set; } + + /// + /// Reusable hooks invoked for every generated SDK request. + /// + public global::System.Collections.Generic.List Hooks { get; } = + new global::System.Collections.Generic.List(); + + /// + /// Registers a hook for all requests issued by this client. + /// + /// + /// The current options instance. + public global::AI21.AutoSDKClientOptions AddHook( + global::AI21.IAutoSDKHook hook) + { + Hooks.Add(hook ?? throw new global::System.ArgumentNullException(nameof(hook))); + return this; + } + + /// + /// Optional per-request authorization provider invoked before each request is sent. + /// Set this when the client is registered as a singleton in DI but each call needs + /// a fresh credential resolved from a provider, secret-store, or session — instead + /// of mutating the shared Authorizations list at construction time. + /// + public global::AI21.IAutoSDKAuthorizationProvider? AuthorizationProvider { get; set; } + + /// + /// Convenience helper that registers + /// using so request-level auth is resolved without + /// touching shared client state. + /// + /// + public global::AI21.AutoSDKClientOptions UseAuthorizationProvider( + global::AI21.IAutoSDKAuthorizationProvider provider) + { + AuthorizationProvider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); + if (Hooks.Find(static x => x is global::AI21.AutoSDKAuthorizationProviderHook) == null) + { + Hooks.Add(new global::AI21.AutoSDKAuthorizationProviderHook()); + } + + return this; + } + } + + /// + /// A request-level authorization value supplied by . + /// Mirrors the runtime fields the SDK applies for HTTP / OAuth2 / API-key auth without + /// requiring the consumer to construct the generated EndPointAuthorization type. + /// + public readonly struct AutoSDKAuthorizationValue + { + /// + /// Initializes a new . + /// + /// + /// + /// + /// + /// + public AutoSDKAuthorizationValue( + string value, + string scheme = "Bearer", + string? headerName = null, + string location = "Header", + string type = "Http") + { + Value = value ?? string.Empty; + Scheme = string.IsNullOrWhiteSpace(scheme) ? "Bearer" : scheme; + HeaderName = headerName ?? string.Empty; + Location = string.IsNullOrWhiteSpace(location) ? "Header" : location; + Type = string.IsNullOrWhiteSpace(type) ? "Http" : type; + } + + /// The credential value (token, API key, etc.). + public string Value { get; } + + /// The HTTP authorization scheme — typically Bearer, Basic, or Token. + public string Scheme { get; } + + /// The custom header name when is ApiKey; ignored for HTTP/OAuth2 auth. + public string HeaderName { get; } + + /// The credential location — Header, Query, or Cookie. + public string Location { get; } + + /// The auth type — Http, OAuth2, OpenIdConnect, or ApiKey. + public string Type { get; } + + /// Convenience factory for a Bearer token. + public static global::AI21.AutoSDKAuthorizationValue Bearer(string token) => new(value: token, scheme: "Bearer"); + + /// Convenience factory for an API-key header. + public static global::AI21.AutoSDKAuthorizationValue ApiKeyHeader(string name, string value) => + new(value: value, headerName: name, location: "Header", type: "ApiKey"); + } + + /// + /// Resolves request-level authorization values without mutating the shared client + /// authorization list. Implementations should be safe to invoke concurrently — + /// the hook calls them once per outgoing request. + /// + public interface IAutoSDKAuthorizationProvider + { + /// + /// Returns one or more values to apply to + /// the current request, or an empty list / null to leave the request as-is. + /// + /// + global::System.Threading.Tasks.Task?> ResolveAsync( + global::AI21.AutoSDKHookContext context); + } + + /// + /// Marker keys stamped onto outgoing + /// instances so consumer s — and any + /// other transport-layer code that runs after AutoSDK's send pipeline — can observe whether + /// the resolved Authorization is call-scoped and opt out of overwriting it with a + /// rotation-aware account-level credential. + /// + public static class AutoSDKHttpRequestOptions + { + /// + /// Key under which records the marker. Exposed + /// for handlers that target frameworks older than .NET 5 and need to read the value + /// through the legacy HttpRequestMessage.Properties bag. + /// + public const string AuthorizationOverrideKey = "AutoSDK.AuthorizationOverride"; + +#if NET5_0_OR_GREATER + /// + /// Strongly-typed for + /// the call-scoped Authorization marker on .NET 5+ targets. Consumers should prefer this + /// over the legacy HttpRequestMessage.Properties bag where available. + /// + public static readonly global::System.Net.Http.HttpRequestOptionsKey AuthorizationOverride = + new global::System.Net.Http.HttpRequestOptionsKey(AuthorizationOverrideKey); +#endif + + /// + /// Stamps the call-scoped Authorization marker on . AutoSDK's + /// built-in calls this whenever the + /// resolved auth came from a per-request override or a client-level + /// . Hand-written SDK extensions that set a + /// non-default Authorization header (e.g. a session-scoped bearer returned by an + /// upstream poll) should call this too so downstream rotation handlers know to skip the + /// overwrite. + /// + /// + public static void StampAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return; + } + +#if NET5_0_OR_GREATER + request.Options.Set(AuthorizationOverride, true); +#else +#pragma warning disable CS0618 // HttpRequestMessage.Properties is obsolete in NET5+, but the only option below it. + request.Properties[AuthorizationOverrideKey] = true; +#pragma warning restore CS0618 +#endif + } + + /// + /// Returns true when previously marked the + /// request as carrying a call-scoped Authorization. + /// + /// + public static bool HasAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return false; + } + +#if NET5_0_OR_GREATER + return request.Options.TryGetValue(AuthorizationOverride, out var value) && value; +#else +#pragma warning disable CS0618 + return request.Properties.TryGetValue(AuthorizationOverrideKey, out var raw) && + raw is bool flag && + flag; +#pragma warning restore CS0618 +#endif + } + } + + /// + /// Built-in that consults + /// before every outgoing + /// request and stamps the resolved values onto the . + /// + public sealed class AutoSDKAuthorizationProviderHook : global::AI21.AutoSDKHook + { + /// + public override async global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::AI21.AutoSDKHookContext context) + { + context = context ?? throw new global::System.ArgumentNullException(nameof(context)); + + if (context.Request == null) + { + return; + } + + var perRequest = context.RequestOptions?.Authorizations; + if (perRequest != null && perRequest.Count > 0) + { + for (var index = 0; index < perRequest.Count; index++) + { + ApplyAuthorization(context.Request, perRequest[index]); + } + + global::AI21.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + return; + } + + var provider = context.ClientOptions?.AuthorizationProvider; + if (provider == null) + { + return; + } + + var resolved = await provider.ResolveAsync(context).ConfigureAwait(false); + if (resolved == null || resolved.Count == 0) + { + return; + } + + for (var index = 0; index < resolved.Count; index++) + { + ApplyAuthorization(context.Request, resolved[index]); + } + + global::AI21.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + } + + private static void ApplyAuthorization( + global::System.Net.Http.HttpRequestMessage request, + global::AI21.AutoSDKAuthorizationValue authorization) + { + switch (authorization.Type) + { + case "Http": + case "OAuth2": + case "OpenIdConnect": + request.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: authorization.Scheme, + parameter: authorization.Value); + break; + case "ApiKey": + if (string.Equals(authorization.Location, "Header", global::System.StringComparison.OrdinalIgnoreCase) && + !string.IsNullOrEmpty(authorization.HeaderName)) + { + request.Headers.Remove(authorization.HeaderName); + request.Headers.TryAddWithoutValidation(authorization.HeaderName, authorization.Value ?? string.Empty); + } + break; + } + } + } + + /// + /// Per-request overrides applied on top of . + /// + public sealed class AutoSDKRequestOptions + { + /// + /// Additional headers applied after generated and client-level headers. + /// + public global::System.Collections.Generic.Dictionary Headers { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.OrdinalIgnoreCase); + + /// + /// Additional query parameters appended after generated and client-level query parameters. + /// + public global::System.Collections.Generic.Dictionary QueryParameters { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.Ordinal); + + /// + /// Optional timeout override for this request. + /// + public global::System.TimeSpan? Timeout { get; set; } + + /// + /// Optional retry override for this request. + /// + public global::AI21.AutoSDKRetryOptions? Retry { get; set; } + + /// + /// Overrides response buffering for this request when set. + /// + public bool? ReadResponseAsString { get; set; } + + /// + /// Optional per-request authorization values. When non-empty, the built-in + /// applies these instead of consulting + /// for this request only. + /// Useful for multi-tenant routing or "act-as" admin tooling that needs a different + /// credential per call without mutating shared client state. + /// + public global::System.Collections.Generic.IReadOnlyList? Authorizations { get; set; } + } + + /// + /// Retry settings for generated HTTP requests. + /// + public sealed class AutoSDKRetryOptions + { + /// + /// Total number of attempts, including the initial request. + /// Values less than 1 are normalized to 1. + /// + public int MaxAttempts { get; set; } = 1; + + /// + /// 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"; + } + + + /// + /// Runtime hook interface for generated SDK lifecycle events. + /// + public interface IAutoSDKHook + { + /// + /// Runs before a request is sent. + /// + /// + global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::AI21.AutoSDKHookContext context); + + /// + /// Runs after a successful HTTP response is received. + /// + /// + global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::AI21.AutoSDKHookContext context); + + /// + /// Runs after an error response or transport failure is observed. + /// + /// + global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::AI21.AutoSDKHookContext context); + } + + /// + /// Convenience base type for request hooks with no-op defaults. + /// + public abstract class AutoSDKHook : global::AI21.IAutoSDKHook + { + /// + public virtual global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::AI21.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::AI21.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::AI21.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + } + + /// + /// Runtime metadata passed to generated SDK hooks. + /// + public sealed class AutoSDKHookContext + { + /// + /// The source OpenAPI operation id or generated fallback id. + /// + public string OperationId { get; set; } = string.Empty; + + /// + /// The generated C# method name. + /// + public string MethodName { get; set; } = string.Empty; + + /// + /// The OpenAPI path template for the operation. + /// + public string PathTemplate { get; set; } = string.Empty; + + /// + /// The HTTP method used for the request. + /// + public string HttpMethod { get; set; } = string.Empty; + + /// + /// The client's resolved base URI. + /// + public global::System.Uri? BaseUri { get; set; } + + /// + /// The outgoing HTTP request for the current attempt. + /// + public global::System.Net.Http.HttpRequestMessage Request { get; set; } = null!; + + /// + /// The HTTP response when one was received. + /// + public global::System.Net.Http.HttpResponseMessage? Response { get; set; } + + /// + /// The transport or processing exception when one was observed. + /// + public global::System.Exception? Exception { get; set; } + + /// + /// The client-wide runtime options. + /// + public global::AI21.AutoSDKClientOptions ClientOptions { get; set; } = null!; + + /// + /// The per-request runtime options. + /// + public global::AI21.AutoSDKRequestOptions? RequestOptions { get; set; } + + /// + /// The current attempt number, starting at 1. + /// + public int Attempt { get; set; } + + /// + /// The total number of attempts allowed for this request. + /// + public int MaxAttempts { get; set; } + + /// + /// Indicates whether the generated client will retry after this hook invocation. + /// + 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. + /// + public global::System.Threading.CancellationToken CancellationToken { get; set; } + } + + + internal static class AutoSDKRequestOptionsSupport + { + internal static global::AI21.AutoSDKHookContext CreateHookContext( + string operationId, + string methodName, + string pathTemplate, + string httpMethod, + global::System.Uri? baseUri, + global::System.Net.Http.HttpRequestMessage request, + global::System.Net.Http.HttpResponseMessage? response, + global::System.Exception? exception, + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + int attempt, + int maxAttempts, + bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, + global::System.Threading.CancellationToken cancellationToken) + { + return new global::AI21.AutoSDKHookContext + { + OperationId = operationId ?? string.Empty, + MethodName = methodName ?? string.Empty, + PathTemplate = pathTemplate ?? string.Empty, + HttpMethod = httpMethod ?? string.Empty, + BaseUri = baseUri, + Request = request, + Response = response, + Exception = exception, + ClientOptions = clientOptions, + RequestOptions = requestOptions, + Attempt = attempt, + MaxAttempts = maxAttempts, + WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, + CancellationToken = cancellationToken, + }; + } + + internal static global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnBeforeRequestAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterSuccessAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterErrorAsync(hookContext), context); + } + + internal static bool GetReadResponseAsString( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + bool fallbackValue) + { + return requestOptions?.ReadResponseAsString ?? + clientOptions.ReadResponseAsString ?? + fallbackValue; + } + + internal static global::System.Threading.CancellationTokenSource? CreateTimeoutCancellationTokenSource( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + global::System.Threading.CancellationToken cancellationToken) + { + var timeout = requestOptions?.Timeout ?? clientOptions.Timeout; + if (!timeout.HasValue || timeout.Value <= global::System.TimeSpan.Zero) + { + return null; + } + + var cancellationTokenSource = global::System.Threading.CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + cancellationTokenSource.CancelAfter(timeout.Value); + return cancellationTokenSource; + } + + internal static int GetMaxAttempts( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + bool supportsRetry) + { + if (!supportsRetry) + { + return 1; + } + + var maxAttempts = requestOptions?.Retry?.MaxAttempts ?? + clientOptions.Retry?.MaxAttempts ?? + 1; + return maxAttempts < 1 ? 1 : maxAttempts; + } + + internal static global::System.TimeSpan GetRetryDelay( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::AI21.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) + { + if (retryDelay <= global::System.TimeSpan.Zero) + { + return; + } + + 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::AI21.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( + global::System.Net.HttpStatusCode statusCode) + { + return (int)statusCode switch + { + 408 => true, + 429 => true, + 500 => true, + 502 => true, + 503 => true, + 504 => true, + _ => false, + }; + } + + internal static string AppendQueryParameters( + string path, + global::System.Collections.Generic.Dictionary clientParameters, + global::System.Collections.Generic.Dictionary? requestParameters) + { + var hasClientParameters = clientParameters != null && clientParameters.Count > 0; + var hasRequestParameters = requestParameters != null && requestParameters.Count > 0; + if (!hasClientParameters && !hasRequestParameters) + { + return path; + } + + var builder = new global::System.Text.StringBuilder(path ?? string.Empty); + var hasQuery = builder.ToString().IndexOf("?", global::System.StringComparison.Ordinal) >= 0; + AppendParameters(builder, clientParameters, ref hasQuery); + AppendParameters(builder, requestParameters, ref hasQuery); + return builder.ToString(); + } + + internal static void ApplyHeaders( + global::System.Net.Http.HttpRequestMessage request, + global::System.Collections.Generic.Dictionary clientHeaders, + global::System.Collections.Generic.Dictionary? requestHeaders) + { + ApplyHeadersCore(request, clientHeaders); + ApplyHeadersCore(request, requestHeaders); + } + + private static void AppendParameters( + global::System.Text.StringBuilder builder, + global::System.Collections.Generic.Dictionary? parameters, + ref bool hasQuery) + { + if (parameters == null || parameters.Count == 0) + { + return; + } + + foreach (var parameter in parameters) + { + builder.Append(hasQuery ? '&' : '?'); + builder.Append(global::System.Uri.EscapeDataString(parameter.Key)); + builder.Append('='); + builder.Append(global::System.Uri.EscapeDataString(parameter.Value ?? string.Empty)); + hasQuery = true; + } + } + + private static void ApplyHeadersCore( + global::System.Net.Http.HttpRequestMessage request, + global::System.Collections.Generic.Dictionary? headers) + { + if (headers == null || headers.Count == 0) + { + return; + } + + foreach (var header in headers) + { + request.Headers.Remove(header.Key); + request.Content?.Headers.Remove(header.Key); + + if (!request.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty) && + request.Content != null) + { + request.Content.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty); + } + } + } + + private static async global::System.Threading.Tasks.Task InvokeHooksAsync( + global::AI21.AutoSDKClientOptions clientOptions, + global::System.Func callback, + global::AI21.AutoSDKHookContext context) + { + if (clientOptions.Hooks == null || clientOptions.Hooks.Count == 0) + { + return; + } + + foreach (var hook in clientOptions.Hooks) + { + if (hook == null) + { + continue; + } + + await callback(hook, context).ConfigureAwait(false); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.PathBuilder.g.cs b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs index b958ca34..9b14c9a1 100644 --- a/src/libs/AI21/Generated/AI21.PathBuilder.g.cs +++ b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs @@ -275,6 +275,11 @@ public class EndPointAuthorization /// public string Type { get; set; } = string.Empty; + /// + /// + /// + public string SchemeId { get; set; } = string.Empty; + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs index 339b1515..745b4976 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs @@ -14,6 +14,7 @@ public partial class RagEngineClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1LibraryManagementResponseContent( /// Get Batch Ingestion Status /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagementAsync( global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagementAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Batch Ingestion Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagementAsResponseAsync( + global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1LibraryManagementResponseContent( securityRequirements: s_V1LibraryManagementSecurityRequirements, operationName: "V1LibraryManagementAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/batches/{batchId}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/batches/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1LibraryManagementResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagementRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagementRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagementResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/status\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/status\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagementResponseContent( + response: __response); + ProcessV1LibraryManagementResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.IngestionBatchStatusResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/status\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/status\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.IngestionBatchStatusResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.IngestionBatchStatusResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::AI21.IngestionBatchStatusResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs index 0cf795b5..ff6fcbd1 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs @@ -14,6 +14,7 @@ public partial class RagEngineClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1LibraryManagement2ResponseContent( /// Generate Documents Signed Url /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement2AsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Documents Signed Url + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1LibraryManagement2ResponseContent( securityRequirements: s_V1LibraryManagement2SecurityRequirements, operationName: "V1LibraryManagement2Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}/download", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}/download", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,146 +132,326 @@ partial void ProcessV1LibraryManagement2ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagement2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement2ResponseContent( + response: __response); + ProcessV1LibraryManagement2Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs index 92aca013..d2e3ec0f 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs @@ -14,6 +14,7 @@ public partial class RagEngineClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessV1LibraryManagement3ResponseContent( /// Download parsed document with Content-Disposition header for immediate download. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement3AsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Download Parsed Document
+ /// Download parsed document with Content-Disposition header for immediate download. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessV1LibraryManagement3ResponseContent( securityRequirements: s_V1LibraryManagement3SecurityRequirements, operationName: "V1LibraryManagement3Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}/parsed", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}/parsed", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,146 +134,326 @@ partial void ProcessV1LibraryManagement3ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagement3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement3ResponseContent( + response: __response); + ProcessV1LibraryManagement3Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibrarySearch.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibrarySearch.g.cs index af68f868..02aeede3 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibrarySearch.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibrarySearch.g.cs @@ -14,6 +14,7 @@ public partial class RagEngineClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1LibrarySearchResponseContent( /// Search ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibrarySearchAsync( global::AI21.LibrarySearchRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibrarySearchAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibrarySearchAsResponseAsync( + + global::AI21.LibrarySearchRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1LibrarySearchResponseContent( securityRequirements: s_V1LibrarySearchSecurityRequirements, operationName: "V1LibrarySearchAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/library/search", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/search", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessV1LibrarySearchResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibrarySearchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibrarySearchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibrarySearchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibrarySearch", + methodName: "V1LibrarySearchAsync", + pathTemplate: "\"/studio/v1/library/search\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibrarySearch", + methodName: "V1LibrarySearchAsync", + pathTemplate: "\"/studio/v1/library/search\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibrarySearch", + methodName: "V1LibrarySearchAsync", + pathTemplate: "\"/studio/v1/library/search\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibrarySearchResponseContent( + response: __response); + ProcessV1LibrarySearchResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibrarySearch", + methodName: "V1LibrarySearchAsync", + pathTemplate: "\"/studio/v1/library/search\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibrarySearch", + methodName: "V1LibrarySearchAsync", + pathTemplate: "\"/studio/v1/library/search\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibrarySearchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Search @@ -257,6 +484,7 @@ partial void ProcessV1LibrarySearchResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibrarySearchAsync( @@ -271,6 +499,7 @@ partial void ProcessV1LibrarySearchResponseContent( int? maxNeighbors = default, double? retrievalSimilarityThreshold = default, double? hybridSearchAlpha = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.LibrarySearchRequest @@ -290,6 +519,7 @@ partial void ProcessV1LibrarySearchResponseContent( return await V1LibrarySearchAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs index 902b80d3..dc233d73 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class RagEngineClient : global::AI21.IRagEngineClient, glo #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public RagEngineClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the RagEngineClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public RagEngineClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the RagEngineClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public RagEngineClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, bool disposeHttpClient = true) { + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs index 936a58d7..86c3aad5 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessV1SecretStorageResponseContent( /// /// Get Secret List /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorageAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorageAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Secret List + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SecretStorageAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessV1SecretStorageResponseContent( securityRequirements: s_V1SecretStorageSecurityRequirements, operationName: "V1SecretStorageAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/secrets", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/secrets", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,107 +124,288 @@ partial void ProcessV1SecretStorageResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1SecretStorageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorageRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return __content; + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.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), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return __content; + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SecretStorageResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SecretStorageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs index ac5c87d5..ab1eebf2 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1SecretStorage2ResponseContent( /// Save Secret /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage2Async( global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorage2AsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Save Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SecretStorage2AsResponseAsync( + + global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1SecretStorage2ResponseContent( securityRequirements: s_V1SecretStorage2SecurityRequirements, operationName: "V1SecretStorage2Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/secrets", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/secrets", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,163 +137,345 @@ partial void ProcessV1SecretStorage2ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1SecretStorage2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorage2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorage2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorage2ResponseContent( + response: __response); + ProcessV1SecretStorage2Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SecretStorage2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Save Secret /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage2Async( string secretName, string secretValue, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateSecretPayload @@ -257,6 +486,7 @@ partial void ProcessV1SecretStorage2ResponseContent( return await V1SecretStorage2Async( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs index bf282ef4..a4a22faa 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1SecretStorage3ResponseContent( /// Delete Secret ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage3Async( string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorage3AsResponseAsync( + secretId: secretId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SecretStorage3AsResponseAsync( + string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1SecretStorage3ResponseContent( securityRequirements: s_V1SecretStorage3SecurityRequirements, operationName: "V1SecretStorage3Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/secrets", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("secret_id", secretId) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/secrets", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("secret_id", secretId) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1SecretStorage3ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1SecretStorage3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - secretId: secretId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorage3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + secretId: secretId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorage3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "DELETE", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "DELETE", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "DELETE", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorage3ResponseContent( + response: __response); + ProcessV1SecretStorage3Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "DELETE", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "DELETE", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SecretStorage3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs index e5f4fd31..21359ce9 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1SecretStorage4ResponseContent( ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorage4AsResponseAsync( + secretId: secretId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Secret + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SecretStorage4AsResponseAsync( + string secretId, + + global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1SecretStorage4ResponseContent( securityRequirements: s_V1SecretStorage4SecurityRequirements, operationName: "V1SecretStorage4Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/secrets/{secretId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/secrets/{secretId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,153 +145,333 @@ partial void ProcessV1SecretStorage4ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1SecretStorage4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - secretId: secretId, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorage4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + secretId: secretId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorage4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + httpMethod: "PATCH", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + httpMethod: "PATCH", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + httpMethod: "PATCH", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorage4ResponseContent( + response: __response); + ProcessV1SecretStorage4Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + httpMethod: "PATCH", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + httpMethod: "PATCH", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SecretStorage4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Secret @@ -249,12 +479,14 @@ partial void ProcessV1SecretStorage4ResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, string? secretName = default, string? secretValue = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.UpdateSecretPayload @@ -266,6 +498,7 @@ partial void ProcessV1SecretStorage4ResponseContent( return await V1SecretStorage4Async( secretId: secretId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.g.cs index 7f9c8028..5f689dc0 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class SecretsClient : global::AI21.ISecretsClient, global: #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public SecretsClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SecretsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SecretsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SecretsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SecretsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, bool disposeHttpClient = true) { + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.Security.g.cs b/src/libs/AI21/Generated/AI21.Security.g.cs index cfc236d4..a2356a01 100644 --- a/src/libs/AI21/Generated/AI21.Security.g.cs +++ b/src/libs/AI21/Generated/AI21.Security.g.cs @@ -6,6 +6,8 @@ internal sealed class EndPointAuthorizationRequirement { internal string Type { get; set; } = string.Empty; + internal string SchemeId { get; set; } = string.Empty; + internal string Location { get; set; } = string.Empty; internal string Name { get; set; } = string.Empty; @@ -97,7 +99,18 @@ private static bool Matches( return requiredAuthorization.Type switch { - "OAuth2" => true, + "OAuth2" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "OpenIdConnect" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "MutualTLS" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), "Http" => string.Equals( availableAuthorization.Name, requiredAuthorization.Name, diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs index 0f098cae..c8093c82 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( /// Create Client Config /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorCreateConfigAsync( global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorCreateConfigAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Client Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorCreateConfigAsResponseAsync( + + global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( securityRequirements: s_V1WebsiteConnectorCreateConfigSecurityRequirements, operationName: "V1WebsiteConnectorCreateConfigAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/client-config", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/client-config", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorCreateConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorCreateConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorCreateConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorCreateConfigResponseContent( + response: __response); + ProcessV1WebsiteConnectorCreateConfigResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorCreateConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Client Config @@ -250,6 +477,7 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorCreateConfigAsync( @@ -259,6 +487,7 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( bool? extractLinkedFiles = default, bool? waitForDynamicContent = default, string? localization = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorCreateConfigPayload @@ -273,6 +502,7 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( return await V1WebsiteConnectorCreateConfigAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs index af1c7258..40da99e1 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1WebsiteConnectorGetConfigResponseContent( /// Get Client Config /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorGetConfigAsync( string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorGetConfigAsResponseAsync( + configName: configName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Client Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorGetConfigAsResponseAsync( + string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1WebsiteConnectorGetConfigResponseContent( securityRequirements: s_V1WebsiteConnectorGetConfigSecurityRequirements, operationName: "V1WebsiteConnectorGetConfigAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/client-config", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("config_name", configName) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/client-config", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("config_name", configName) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1WebsiteConnectorGetConfigResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorGetConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - configName: configName); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorGetConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configName: configName!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorGetConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorGetConfigResponseContent( + response: __response); + ProcessV1WebsiteConnectorGetConfigResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-config\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorGetConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs index 39f1d8d0..e542a88a 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1WebsiteConnectorGetUrlStatusResponseContent( /// Get Url Status ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorGetUrlStatusAsync( string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorGetUrlStatusAsResponseAsync( + urlId: urlId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Url Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorGetUrlStatusAsResponseAsync( + string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1WebsiteConnectorGetUrlStatusResponseContent( securityRequirements: s_V1WebsiteConnectorGetUrlStatusSecurityRequirements, operationName: "V1WebsiteConnectorGetUrlStatusAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/url-status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("url_id", urlId) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/url-status", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("url_id", urlId) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1WebsiteConnectorGetUrlStatusResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorGetUrlStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - urlId: urlId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorGetUrlStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + urlId: urlId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorGetUrlStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-status\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-status\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorGetUrlStatusResponseContent( + response: __response); + ProcessV1WebsiteConnectorGetUrlStatusResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-status\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-status\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorGetUrlStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs index 87a49437..6685561a 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( /// Get Website Status ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorGetWebsiteStatusAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorGetWebsiteStatusAsResponseAsync( + websiteId: websiteId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Website Status + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorGetWebsiteStatusAsResponseAsync( + global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( securityRequirements: s_V1WebsiteConnectorGetWebsiteStatusSecurityRequirements, operationName: "V1WebsiteConnectorGetWebsiteStatusAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/website-status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("website_id", websiteId.ToString()!) - ; - var __path = __pathBuilder.ToString(); - using 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/website-status", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("website_id", websiteId.ToString()!) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorGetWebsiteStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - websiteId: websiteId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorGetWebsiteStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + websiteId: websiteId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorGetWebsiteStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-status\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-status\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( + response: __response); + ProcessV1WebsiteConnectorGetWebsiteStatusResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-status\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-status\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs index b1b0ee91..a9094c40 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( /// Connect Website ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorIngestUrlAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Connect Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestUrlAsResponseAsync( + + global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( securityRequirements: s_V1WebsiteConnectorIngestUrlSecurityRequirements, operationName: "V1WebsiteConnectorIngestUrlAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/ingest-url", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/ingest-url", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,161 +137,343 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorIngestUrlRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorIngestUrlRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorIngestUrlResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorIngestUrlResponseContent( + response: __response); + ProcessV1WebsiteConnectorIngestUrlResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorIngestUrlResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Connect Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorIngestUrlPayload @@ -254,6 +483,7 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( return await V1WebsiteConnectorIngestUrlAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs index 0388fbd9..f74ee1b0 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( /// Ingest Website ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorIngestWebsiteAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( securityRequirements: s_V1WebsiteConnectorIngestWebsiteSecurityRequirements, operationName: "V1WebsiteConnectorIngestWebsiteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/ingest-website", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/ingest-website", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorIngestWebsiteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorIngestWebsiteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorIngestWebsiteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorIngestWebsiteResponseContent( + response: __response); + ProcessV1WebsiteConnectorIngestWebsiteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorIngestWebsiteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Ingest Website @@ -243,12 +470,14 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( string sitemapUrl, string? clientConfig = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorIngestWebsitePayload @@ -260,6 +489,7 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( return await V1WebsiteConnectorIngestWebsiteAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs index 84a7685f..23475bf4 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorRetryIngestWebsiteAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retry Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorRetryIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( securityRequirements: s_V1WebsiteConnectorRetryIngestWebsiteSecurityRequirements, operationName: "V1WebsiteConnectorRetryIngestWebsiteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/retry-ingest-website", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/retry-ingest-website", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; + __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 == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,161 +137,343 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorRetryIngestWebsiteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorRetryIngestWebsiteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorRetryIngestWebsiteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( + response: __response); + ProcessV1WebsiteConnectorRetryIngestWebsiteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.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), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorRetryIngestWebsitePayload @@ -254,6 +483,7 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( return await V1WebsiteConnectorRetryIngestWebsiteAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs index fca0ae48..cd12cb5e 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class WebsiteConnectorClient : global::AI21.IWebsiteConnec #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public WebsiteConnectorClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the WebsiteConnectorClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public WebsiteConnectorClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the WebsiteConnectorClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public WebsiteConnectorClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, bool disposeHttpClient = true) { + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/openapi.json b/src/libs/AI21/openapi.json index d882827c..35059fc2 100644 --- a/src/libs/AI21/openapi.json +++ b/src/libs/AI21/openapi.json @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"AI21 Studio API","description":"Access our powerful language models using an API that makes you smile","version":"1.0.0"},"paths":{"/studio/v1/chat/files/convert":{"post":{"summary":"Convert Document File","operationId":"convert_document_file_studio_v1_chat_files_convert_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_convert_document_file_studio_v1_chat_files_convert_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/chat/completions":{"post":{"tags":["Jamba Complete"],"summary":"Studio Chat Complete","description":"This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).\nThis is a foundation model that supports both single-turn (question answering,\ntext completion) and multi-turn (chat style) interactions.\n\nYou can optionally stream results if you want to get the response as each\ntoken is generated, rather than waiting for the entire response.","operationId":"v1_chat_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletion"},{"items":{"$ref":"#/components/schemas/ChatCompletionVllmStreamingMessage"},"type":"array"}],"title":"Response V1 Chat Complete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files":{"get":{"tags":["Library management"],"summary":"Get Workspace Files","description":"Get metadata about a specific file by file ID. The file ID is generated by\nAI21 when you upload the file.","operationId":"v1_library_management","parameters":[{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"},{"required":false,"schema":{"type":"string","title":"Path"},"name":"path","in":"query"},{"required":false,"schema":{"$ref":"#/components/schemas/FileStatus"},"name":"status","in":"query"},{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Label"},"name":"label","in":"query"},{"required":false,"schema":{"type":"integer","title":"Limit","default":500000},"name":"limit","in":"query"},{"required":false,"schema":{"type":"integer","title":"Offset"},"name":"offset","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FileResponse"},"type":"array","title":"Response V1 Library Management"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Library management"],"summary":"Upload Workspace File","description":"Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).\nYou can assign metadata to your files to limit searches to specific files by file metadata.\nThere is no bulk upload method; files must be loaded one at a time.\n\n- **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.\n- **Max library size:** 1 GB total size. No limit to individual file size.\n- **Supported file types:** PDF, DocX, HTML, TXT","operationId":"v1_library_upload","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_library_upload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}":{"get":{"tags":["Library management"],"summary":"Get File By Id","description":"Retrieve a list of documents in the user's library. Optionally specify a\nfilter to find only files with matching labels or paths. This method\nreturns only metadata about files; to download a file, call\n`GET .../files/{file_id}/download`\n\nWhen specifying qualifiers with your request, only files that match\n_all_ qualifiers will be returns. So, for example, if you specify\n`label='financial'` and `status='UPLOADED'`, only files with the label\n\"financial\" AND status UPLOADED will be returned.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Library management"],"summary":"Update File","description":"Update the specified parameters of a specific document in the user's library.\nThis operation currently supports updating the publicUrl and labels parameters.\n\n> **This operation overwrites the specified items with the new data you provide.**\n> If you wish to add new labels to the labels list without removing the existing ones,\n> you must submit a labels list that includes both the current and new labels.**\n>\n> For instance, if the current labels are \"Label A\" and \"Label B\", and you wish to\n> add \"New Label C\" and \"New Label D\" to the list, you must specify `\"labels\": [\"Label A\", \"Label B\", \"New Label C\", \"New Label D\"]`.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Library management"],"summary":"Delete File","description":"Delete the specified file from the library.\n\n**Restrictions**:\nFiles in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a 422 error.","operationId":"v1_library_delete","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/search":{"post":{"tags":["RAG Engine"],"summary":"Search","operationId":"v1_library_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibrarySearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets":{"get":{"tags":["Secrets"],"summary":"Get Secret List","operationId":"v1_secret_storage","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Secrets"],"summary":"Save Secret","operationId":"v1_secret_storage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Secrets"],"summary":"Delete Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets/{secret_id}":{"patch":{"tags":["Secrets"],"summary":"Update Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/batches/{batch_id}/status":{"get":{"tags":["RAG Engine"],"summary":"Get Batch Ingestion Status","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestionBatchStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/download":{"get":{"tags":["RAG Engine"],"summary":"Generate Documents Signed Url","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/parsed":{"get":{"tags":["RAG Engine"],"summary":"Download Parsed Document","description":"Download parsed document with Content-Disposition header for immediate download.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/tokens":{"post":{"summary":"Generate Org Token","operationId":"generate_org_token_studio_v1_connectors_connected_users__entity_id__tokens_post","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources":{"get":{"summary":"Get Org Data Sources Info","operationId":"get_org_data_sources_info_studio_v1_connectors_connected_users__entity_id__data_sources_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsDataSources"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/status":{"get":{"summary":"Get Data Source Status","operationId":"get_data_source_status_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Paragon Token"},"name":"paragon_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/connection-status":{"get":{"summary":"Get Connector Connection Status","operationId":"get_connector_connection_status_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__connection_status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Paragon Token"},"name":"paragon_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorConnectionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/workflows/{workflow_name}/run":{"post":{"summary":"Run Workflow","operationId":"run_workflow_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__workflows__workflow_name__run_post","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Workflow Name"},"name":"workflow_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/data-sources/syncs":{"post":{"summary":"Run Sync","operationId":"run_sync_studio_v1_connectors_connected_users_data_sources_syncs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsSyncParams"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website":{"get":{"summary":"Get Website Connector","operationId":"get_website_connector_studio_v1_connectors_website_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Post Website Connector","operationId":"post_website_connector_studio_v1_connectors_website_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website/{connector_id}":{"get":{"summary":"Get Website Connector By Id","operationId":"get_website_connector_by_id_studio_v1_connectors_website__connector_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Website Connector","operationId":"delete_website_connector_studio_v1_connectors_website__connector_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website/{connector_id}/sync":{"post":{"summary":"Sync Website","operationId":"sync_website_studio_v1_connectors_website__connector_id__sync_post","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/paragon/webhook":{"post":{"summary":"Forward Paragon Webhook","operationId":"forward_paragon_webhook_studio_v1_connectors_paragon_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/maestro/runs":{"post":{"summary":"Create Maestro Run","operationId":"v1_maestro_run","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMaestroRunsPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/maestro/runs/{execution_id}":{"get":{"summary":"Get Maestro Run","operationId":"v1_get_maestro_run","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos":{"get":{"summary":"List Demos","description":"List all available demos.","operationId":"list_demos_studio_v1_demos_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Demo"},"type":"array","title":"Response List Demos Studio V1 Demos Get"}}}}}},"post":{"summary":"Create Demo","description":"Create a new demo.","operationId":"create_demo_studio_v1_demos_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/{demo_id}":{"get":{"summary":"Get Demo","description":"Get a specific demo by ID.","operationId":"get_demo_studio_v1_demos__demo_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Demo","description":"Update an existing demo.","operationId":"update_demo_studio_v1_demos__demo_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Demo","description":"Delete a demo.","operationId":"delete_demo_studio_v1_demos__demo_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/parse-pdf":{"post":{"summary":"Parse Pdf","description":"Parse a PDF file and return its contents.","operationId":"parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Parse Pdf Studio V1 Demos Document Modifier Parse Pdf Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/get-parsed-file":{"get":{"summary":"Get Parsed File","description":"Get the parsed file from the document modifier.","operationId":"get_parsed_file_studio_v1_demos_document_modifier_get_parsed_file_get","parameters":[{"required":true,"schema":{"type":"string","title":"File Name"},"name":"file_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Parsed File Studio V1 Demos Document Modifier Get Parsed File Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/compare-text":{"post":{"summary":"Compare Text","description":"Compare text in a document file against a reference text.","operationId":"compare_text_studio_v1_demos_document_modifier_compare_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompareTextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Compare Text Studio V1 Demos Document Modifier Compare Text Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/download":{"post":{"summary":"Download Modified Document","description":"Download a modified document.","operationId":"download_modified_document_studio_v1_demos_document_modifier_download_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadModifiedDocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/jamba-execute":{"post":{"summary":"Jamba Execute","description":"Execute a Jamba request.","operationId":"jamba_execute_studio_v1_demos_document_modifier_jamba_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JambaExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Jamba Execute Studio V1 Demos Document Modifier Jamba Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/upload-check-compliance":{"post":{"summary":"Upload Check Compliance","description":"Check compliance of a document file against regulatory requirements.","operationId":"upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Upload Check Compliance Studio V1 Demos Regulations Upload Check Compliance Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/vector-store/{vector_store_id}":{"get":{"summary":"Get Vector Store","description":"Get a vector store by ID.","operationId":"get_vector_store_studio_v1_demos_regulations_vector_store__vector_store_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Vector Store Id"},"name":"vector_store_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/generate-response-pdf":{"post":{"summary":"Combine section answers ➜ styled PDF for download","operationId":"generate_response_pdf_studio_v1_demos_rfi_generate_response_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/process-rfi":{"post":{"summary":"Process Rfi Document","operationId":"process_rfi_document_studio_v1_demos_rfi_process_rfi_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RFIResponseSection"},"type":"array","title":"Response Process Rfi Document Studio V1 Demos Rfi Process Rfi Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/file-url/{file_id}":{"get":{"summary":"Get File Url","operationId":"get_file_url_studio_v1_demos_scraper_file_url__file_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"File Id"},"name":"file_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Api Key"},"name":"api_key","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/can-iframe":{"get":{"summary":"Can Iframe","operationId":"can_iframe_studio_v1_demos_scraper_can_iframe_get","parameters":[{"required":true,"schema":{"type":"string","title":"Url"},"name":"url","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Can Iframe Studio V1 Demos Scraper Can Iframe Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-url":{"post":{"tags":["Website Connector"],"summary":"Connect Website","operationId":"v1_website_connector_ingest_url","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestUrlPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/url-status":{"get":{"tags":["Website Connector"],"summary":"Get Url Status","operationId":"v1_website_connector_get_url_status","parameters":[{"required":true,"schema":{"type":"string","title":"Url Id"},"name":"url_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-website":{"post":{"tags":["Website Connector"],"summary":"Ingest Website","operationId":"v1_website_connector_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/website-status":{"get":{"tags":["Website Connector"],"summary":"Get Website Status","operationId":"v1_website_connector_get_website_status","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Website Id"},"name":"website_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/retry-ingest-website":{"post":{"tags":["Website Connector"],"summary":"Retry Ingest Website","operationId":"v1_website_connector_retry_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorRetryIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/client-config":{"get":{"tags":["Website Connector"],"summary":"Get Client Config","operationId":"v1_website_connector_get_config","parameters":[{"required":true,"schema":{"type":"string","title":"Config Name"},"name":"config_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Website Connector"],"summary":"Create Client Config","operationId":"v1_website_connector_create_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorCreateConfigPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas":{"get":{"summary":"Get Organization Schemas","operationId":"get_organization_schemas_studio_v1_structured_rag_organizations__organization_id__schemas_get","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSchemas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Organization Schema","operationId":"create_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schema-detection":{"post":{"summary":"Detect Schema","operationId":"detect_schema_studio_v1_structured_rag_organizations__organization_id__schema_detection_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas/{schema_name}":{"delete":{"summary":"Delete Organization Schema","operationId":"delete_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas__schema_name__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Schema Name"},"name":"schema_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/generation/requirements":{"post":{"summary":"Generate Requirements","operationId":"v1_studio_api_generation_requirements","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/generation/thread-name":{"post":{"summary":"Generate Thread Name","operationId":"v1_studio_api_generation_thread_name","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadNameGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadNameGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/models":{"get":{"summary":"Get Models Info","operationId":"v1_list_models_info","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsInfoResponse"}}}}}}},"/studio/v1/assistants":{"get":{"summary":"Get Assistants","operationId":"v1_list_assistants","parameters":[{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Workspace Ids"},"name":"workspace_ids","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAssistantsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Assistant","operationId":"v1_create_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/generate":{"post":{"summary":"Generate Assistant","operationId":"v1_generate_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}":{"get":{"summary":"Get Assistant","operationId":"v1_get_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Assistant","operationId":"v1_delete_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Assistant","operationId":"v1_modify_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/run":{"post":{"summary":"Run Assistant","operationId":"v1_run_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans":{"get":{"summary":"List Plans","operationId":"v1_list_plans","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPlansResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Plan","operationId":"v1_create_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans/{plan_id}":{"get":{"summary":"Get Plan","operationId":"v1_get_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Plan","operationId":"v1_modify_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes":{"get":{"summary":"Get Routes","operationId":"v1_list_routes","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRoutesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Route","operationId":"v1_create_route","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes/{route_id}":{"get":{"summary":"Get Route","operationId":"v1_get_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Route","operationId":"v1_delete_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Route","operationId":"v1_modify_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/validate_plan":{"post":{"summary":"Validate Plan","operationId":"v1_validate_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/executions/{execution_id}/explanations/steps":{"get":{"summary":"Get Step Explanations","description":"Get step explanations for an execution (cached or generated).\nSet force_regenerate=True to regenerate even if cached.","operationId":"get_step_explanations_studio_v1_executions__execution_id__explanations_steps_get","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Force Regenerate","default":false},"name":"force_regenerate","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/executions/{execution_id}/explanations/output":{"get":{"summary":"Get Output Explanation","description":"Get output explanation for an execution (cached or generated).\nSet force_regenerate=True to regenerate even if cached.","operationId":"get_output_explanation_studio_v1_executions__execution_id__explanations_output_get","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Force Regenerate","default":false},"name":"force_regenerate","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/discover":{"post":{"summary":"Mcp Tool Discovery","operationId":"mcp_tool_discovery_studio_v1_mcp_discover_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPDefinition"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage":{"get":{"summary":"List Mcp Storage","operationId":"list_mcp_storage_studio_v1_mcp_storage_get","parameters":[{"required":false,"schema":{"type":"string","format":"uuid","title":"Workspace Id"},"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMCPsStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Mcp Storage","operationId":"create_mcp_storage_studio_v1_mcp_storage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}":{"get":{"summary":"Get Mcp Storage","operationId":"get_mcp_storage_studio_v1_mcp_storage__mcp_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Mcp Storage","operationId":"delete_mcp_storage_studio_v1_mcp_storage__mcp_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Mcp Storage","operationId":"update_mcp_storage_studio_v1_mcp_storage__mcp_id__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}/assistants":{"get":{"summary":"Get Assistants By Mcp","operationId":"get_assistants_by_mcp_studio_v1_mcp_storage__mcp_id__assistants_get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantsByMcpResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models":{"get":{"summary":"Get Workspace Models By Organization Endpoint","operationId":"get_workspace_models_by_organization_endpoint_studio_v1_settings_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelsResponse"}}}}}}},"/studio/v1/settings/models/available":{"get":{"summary":"Get Available Models Endpoint","operationId":"get_available_models_endpoint_studio_v1_settings_models_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/settings/models/{name}/secrets":{"get":{"summary":"Get Workspace Model Secret Endpoint","operationId":"get_workspace_model_secret_endpoint_studio_v1_settings_models__name__secrets_get","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models/{name}":{"delete":{"summary":"Delete Workspace Model Endpoint","operationId":"delete_workspace_model_endpoint_studio_v1_settings_models__name__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Workspace Model Endpoint","operationId":"update_workspace_model_endpoint_studio_v1_settings_models__name__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag","operationId":"tlv_convrag_solutions_tlv_municipality_convrag_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag Prefix Preview","operationId":"tlv_convrag_prefix_preview_solutions_preview_tlv_municipality_convrag_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications","operationId":"fnac_v1_classifications_solutions_fnac_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions","operationId":"fnac_v1_descriptions_solutions_fnac_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications","operationId":"fnac_v1_deprecated_classifications_solutions_fnac_v1_deprecated_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions","operationId":"fnac_v1_deprecated_descriptions_solutions_fnac_v1_deprecated_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications","operationId":"fnac_batch_classifications_solutions_fd_batches_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status","operationId":"fnac_batch_classifications_status_solutions_fd_batches_v1_classifications__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results","operationId":"fnac_batch_classifications_results_solutions_fd_batches_v1_classifications__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions","operationId":"fnac_batch_descriptions_solutions_fd_batches_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status","operationId":"fnac_batch_descriptions_status_solutions_fd_batches_v1_descriptions__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results","operationId":"fnac_batch_descriptions_results_solutions_fd_batches_v1_descriptions__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications Prefix Preview","operationId":"fnac_v1_classifications_prefix_preview_solutions_preview_fnac_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions Prefix Preview","operationId":"fnac_v1_descriptions_prefix_preview_solutions_preview_fnac_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications Prefix Preview","operationId":"fnac_v1_deprecated_classifications_prefix_preview_solutions_preview_fnac_v1_deprecated_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions Prefix Preview","operationId":"fnac_v1_deprecated_descriptions_prefix_preview_solutions_preview_fnac_v1_deprecated_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications Prefix Preview","operationId":"fnac_batch_classifications_prefix_preview_solutions_preview_fd_batches_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status Prefix Preview","operationId":"fnac_batch_classifications_status_prefix_preview_solutions_preview_fd_batches_v1_classifications__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results Prefix Preview","operationId":"fnac_batch_classifications_results_prefix_preview_solutions_preview_fd_batches_v1_classifications__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions Prefix Preview","operationId":"fnac_batch_descriptions_prefix_preview_solutions_preview_fd_batches_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status Prefix Preview","operationId":"fnac_batch_descriptions_status_prefix_preview_solutions_preview_fd_batches_v1_descriptions__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results Prefix Preview","operationId":"fnac_batch_descriptions_results_prefix_preview_solutions_preview_fd_batches_v1_descriptions__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict","operationId":"fnac_aftersales_batch_predict_solutions_fd_aftersales_parts_classification_batch_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status","operationId":"fnac_aftersales_batch_predict_status_solutions_fd_aftersales_parts_classification_batch__batch_id__status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict Prefix Preview","operationId":"fnac_aftersales_batch_predict_prefix_preview_solutions_preview_fd_aftersales_parts_classification_batch_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status Prefix Preview","operationId":"fnac_aftersales_batch_predict_status_prefix_preview_solutions_preview_fd_aftersales_parts_classification_batch__batch_id__status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/vidaa/summarize":{"post":{"summary":"Vidaa Summarize","operationId":"vidaa_summarize_solutions_vidaa_summarize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/action-items":{"post":{"summary":"Vidaa Action Items","operationId":"vidaa_action_items_solutions_vidaa_action_items_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/sources":{"get":{"summary":"Vidaa Sources","operationId":"vidaa_sources_solutions_vidaa_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/feed-items":{"get":{"summary":"Vidaa Feed Items","operationId":"vidaa_feed_items_solutions_vidaa_feed_items_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/subscribe":{"post":{"summary":"Vidaa Subscribe","operationId":"vidaa_subscribe_solutions_vidaa_subscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/unsubscribe":{"post":{"summary":"Vidaa Unsubscribe","operationId":"vidaa_unsubscribe_solutions_vidaa_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/subscriptions":{"get":{"summary":"Vidaa Subscriptions","operationId":"vidaa_subscriptions_solutions_vidaa_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/scheduler-stats":{"get":{"summary":"Vidaa Scheduler Stats","operationId":"vidaa_scheduler_stats_solutions_vidaa_scheduler_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/trigger-poll":{"post":{"summary":"Vidaa Trigger Poll","operationId":"vidaa_trigger_poll_solutions_vidaa_trigger_poll_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/api/messages":{"post":{"summary":"Vidaa Messages","operationId":"vidaa_messages_solutions_vidaa_api_messages_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/api/messages":{"post":{"summary":"Vidaa Messages Preview","operationId":"vidaa_messages_preview_solutions_preview_vidaa_api_messages_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/summarize":{"post":{"summary":"Vidaa Summarize Preview","operationId":"vidaa_summarize_preview_solutions_preview_vidaa_summarize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/action-items":{"post":{"summary":"Vidaa Action Items Preview","operationId":"vidaa_action_items_preview_solutions_preview_vidaa_action_items_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/sources":{"get":{"summary":"Vidaa Sources Preview","operationId":"vidaa_sources_preview_solutions_preview_vidaa_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/feed-items":{"get":{"summary":"Vidaa Feed Items Preview","operationId":"vidaa_feed_items_preview_solutions_preview_vidaa_feed_items_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/subscribe":{"post":{"summary":"Vidaa Subscribe Preview","operationId":"vidaa_subscribe_preview_solutions_preview_vidaa_subscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/unsubscribe":{"post":{"summary":"Vidaa Unsubscribe Preview","operationId":"vidaa_unsubscribe_preview_solutions_preview_vidaa_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/subscriptions":{"get":{"summary":"Vidaa Subscriptions Preview","operationId":"vidaa_subscriptions_preview_solutions_preview_vidaa_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/scheduler-stats":{"get":{"summary":"Vidaa Scheduler Stats Preview","operationId":"vidaa_scheduler_stats_preview_solutions_preview_vidaa_scheduler_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/trigger-poll":{"post":{"summary":"Vidaa Trigger Poll Preview","operationId":"vidaa_trigger_poll_preview_solutions_preview_vidaa_trigger_poll_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/wpp/query":{"post":{"summary":"Wpp Query","operationId":"wpp_query_solutions_wpp_query_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/wpp/feedback":{"post":{"summary":"Wpp Feedback","operationId":"wpp_feedback_solutions_wpp_feedback_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/wpp/query":{"post":{"summary":"Wpp Query Prefix Preview","operationId":"wpp_query_prefix_preview_solutions_preview_wpp_query_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/wpp/feedback":{"post":{"summary":"Wpp Feedback Prefix Preview","operationId":"wpp_feedback_prefix_preview_solutions_preview_wpp_feedback_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/grant-compliance":{"post":{"summary":"Kirsh Grant Compliance","operationId":"kirsh_grant_compliance_solutions_kirsh_grant_compliance_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/grant-metadata":{"post":{"summary":"Kirsh Grant Metadata","operationId":"kirsh_grant_metadata_solutions_kirsh_grant_metadata_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/funding-and-categorization-check":{"post":{"summary":"Kirsh Funding And Categorization Check","operationId":"kirsh_funding_and_categorization_check_solutions_kirsh_funding_and_categorization_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/public-information-check":{"post":{"summary":"Kirsh Public Information Check","operationId":"kirsh_public_information_check_solutions_kirsh_public_information_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh-document-upload/process":{"post":{"summary":"Kirsh Document Upload Process","operationId":"kirsh_document_upload_process_solutions_kirsh_document_upload_process_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/email-assistant":{"post":{"summary":"Kirsh Email Assistant","operationId":"kirsh_email_assistant_solutions_kirsh_email_assistant_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/grant-compliance":{"post":{"summary":"Kirsh Grant Compliance Prefix Preview","operationId":"kirsh_grant_compliance_prefix_preview_solutions_preview_kirsh_grant_compliance_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/grant-metadata":{"post":{"summary":"Kirsh Grant Metadata Prefix Preview","operationId":"kirsh_grant_metadata_prefix_preview_solutions_preview_kirsh_grant_metadata_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/funding-and-categorization-check":{"post":{"summary":"Kirsh Funding And Categorization Check Prefix Preview","operationId":"kirsh_funding_and_categorization_check_prefix_preview_solutions_preview_kirsh_funding_and_categorization_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/public-information-check":{"post":{"summary":"Kirsh Public Information Check Prefix Preview","operationId":"kirsh_public_information_check_prefix_preview_solutions_preview_kirsh_public_information_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh-document-upload/process":{"post":{"summary":"Kirsh Document Upload Process Prefix Preview","operationId":"kirsh_document_upload_process_prefix_preview_solutions_preview_kirsh_document_upload_process_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/email-assistant":{"post":{"summary":"Kirsh Email Assistant Prefix Preview","operationId":"kirsh_email_assistant_prefix_preview_solutions_preview_kirsh_email_assistant_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/product-lookup":{"post":{"summary":"Claroty Product Lookup","operationId":"claroty_product_lookup_solutions_claroty_product_lookup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/suggest-vendor-model":{"post":{"summary":"Claroty Suggest Vendor Model","operationId":"claroty_suggest_vendor_model_solutions_claroty_suggest_vendor_model_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/scrape-url":{"post":{"summary":"Claroty Scrape Url","operationId":"claroty_scrape_url_solutions_claroty_scrape_url_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Assistant":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"Assistant"},"AssistantBasicInfo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AssistantBasicInfo"},"AssistantMessage":{"properties":{"role":{"type":"string","enum":["assistant"],"title":"Role","default":"assistant","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls"},"reasoning_content":{"type":"string","title":"Reasoning Content"}},"type":"object","title":"AssistantMessage"},"AssistantRoute":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","plan_id","name","description","examples","assistant_id"],"title":"AssistantRoute"},"AssistantType":{"enum":["default","chat","maestro"],"title":"AssistantType","description":"An enumeration."},"AssistantsByMcpResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantBasicInfo"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"AssistantsByMcpResponse"},"AuthenticationType":{"type":"string","enum":["none","token-api","custom-header"],"title":"AuthenticationType","description":"An enumeration."},"Body_convert_document_file_studio_v1_chat_files_convert_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_convert_document_file_studio_v1_chat_files_convert_post"},"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"},"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"RFI document file (PDF supported)"},"budget":{"type":"string","title":"Budget","description":"Budget level: LOW, MEDIUM, or HIGH","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"},"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"budget":{"type":"string","title":"Budget","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"},"Body_v1_library_upload":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"path":{"type":"string","title":"Path"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"publicUrl":{"type":"string","title":"Publicurl"},"custom_configs":{"type":"string","title":"Custom Configs"},"upload_mode":{"allOf":[{"$ref":"#/components/schemas/UploadMode"}],"default":"immediate"},"batch_id":{"type":"string","format":"uuid","title":"Batch Id"},"data_source":{"type":"string","title":"Data Source"},"metadata":{"type":"string","title":"Metadata"}},"type":"object","required":["file"],"title":"Body_v1_library_upload"},"BudgetLevel":{"enum":["low","medium","high"],"title":"BudgetLevel","description":"An enumeration."},"ChatCompletion":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseChoice"},"type":"array","title":"Choices","description":"One or more responses, depending on the `n` parameter from the request.\n"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"The token counts for this request. Per-token billing is based on the\nprompt token and completion token counts and rates.\n"},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices","usage"],"title":"ChatCompletion","description":"Used for non-streaming responses. Streaming responses return `ChatCompletionVllmStreamingMessage`."},"ChatCompletionResponseChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Zero-based index of the message in the list of messages. Note that this might not\ncorrespond with the position in the response list.\n"},"message":{"$ref":"#/components/schemas/AssistantMessage","description":"The message generated by the model. Same structure as the request message, with `role` and `content` members.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"Why the message ended. Possible reasons:\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","message"],"title":"ChatCompletionResponseChoice","description":"A single possible response generated by the system. For non-streaming replies, There\ncan be multiple responses, depending on what `n` value you specified in the request.\n"},"ChatCompletionResponseDeltaChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Always zero in streamed responses."},"delta":{"anyOf":[{"$ref":"#/components/schemas/ChatStreamingFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingContentDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsDelta"}],"title":"Delta","description":"- **The first message** in the stream will be an object set to `{\"role\":\"assistant\"}`.\n- **Subsequent messages** will have an object `{\"content\": __token__}` with the generated token.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"One of the following string values:\n - `null`: All messages but the last will return null for `finish_reason`.\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","delta"],"title":"ChatCompletionResponseDeltaChoice"},"ChatCompletionVllmStreamingMessage":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseDeltaChoice"},"type":"array","title":"Choices","description":"The message"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"Included in the last message only. Total token counts for the message."},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices"],"title":"ChatCompletionVllmStreamingMessage","description":"Returned for streaming messages. Non-streaming responses return `ChatCompletion`."},"ChatRequest":{"properties":{"model":{"$ref":"#/components/schemas/ModelName","description":"The name of the model to use. Choose one of the following values:\n* `jamba-instruct-preview`\n"},"messages":{"items":{"oneOf":[{"$ref":"#/components/schemas/UserMessage"},{"$ref":"#/components/schemas/AssistantMessage"},{"$ref":"#/components/schemas/ToolMessage"},{"$ref":"#/components/schemas/SystemMessage"}],"discriminator":{"propertyName":"role","mapping":{"user":"#/components/schemas/UserMessage","assistant":"#/components/schemas/AssistantMessage","tool":"#/components/schemas/ToolMessage","system":"#/components/schemas/SystemMessage"}}},"type":"array","title":"Messages","description":"The previous messages in this chat, from oldest (index 0) to newest. Messages\nmust be alternating `user`/`assistant` messages, optionally starting with a `system`\nmessage. For single turn interactions, this should be an optional `system` message,\nand a single `user` message. Maximum total size for the list is about 256K tokens.\n"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__chat__ToolDefinition"},"type":"array","title":"Tools"},"n":{"type":"integer","title":"N","default":1,"description":"How many chat responses to generate. _Range: 1 – 16_ **Notes:**\n- If `n > 1`, setting `temperature=0` will fail because all answers are guaranteed to be duplicates.\n- `n` must be 1 when `stream = True`\n"},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096,"description":"The maximum number of tokens to allow for each generated response message. Typically\nthe best way to limit output length is by providing a length limit in the system\nprompt (for example, \"limit your answers to three sentences\"). _Range: 0 – 4096_\n"},"temperature":{"type":"number","title":"Temperature","description":"How much variation to provide in each answer. Setting this value to 0 guarantees the\nsame response to the same question every time. Setting a higher value encourages more\nvariation. Modifies the distribution from which tokens are sampled.\n[More information](https://docs.ai21.com/docs/sampling-from-language-models#temperature)\n_Range: 0.0 – 2.0_\n"},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","default":1,"description":"Limit the pool of next tokens in each step to the top N percentile of possible\ntokens, where 1.0 means the pool of all possible tokens, and 0.01 means the\npool of only the most likely next tokens. [More information]\n(https://docs.ai21.com/docs/sampling-from-language-models#topp) _Range: 0 \\<= value \\<=1.0_\n"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Stop","description":"End the message when the model generates one of these strings. The stop sequence\nis not included in the generated message. Each sequence can be up to 64K long, and\ncan contain newlines as `\\n` characters. Examples:\n- Single stop string with a word and a period: \"monkeys.\"\n- Multiple stop strings and a newline: [\"cat\", \"dog\", \" .\", \"####\", \"\\n\"]\n"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"},"mock_response":{"$ref":"#/components/schemas/MockResponseConfig"},"documents":{"items":{"$ref":"#/components/schemas/DocumentSchema"},"type":"array","title":"Documents","default":[]},"response_format":{"allOf":[{"$ref":"#/components/schemas/ResponseFormat"}],"title":"Response Format","default":{"type":"text"}}},"type":"object","required":["model","messages"],"title":"ChatRequest"},"ChatStreamingContentDelta":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ChatStreamingContentDelta"},"ChatStreamingFirstDelta":{"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"}},"type":"object","required":["role"],"title":"ChatStreamingFirstDelta"},"ChatStreamingToolCallsDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDelta"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsDelta"},"ChatStreamingToolCallsFirstDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDeltaStart"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsFirstDelta"},"CompareTextRequest":{"properties":{"original_text":{"type":"string","title":"Original Text"},"modified_text":{"type":"string","title":"Modified Text"}},"type":"object","required":["original_text","modified_text"],"title":"CompareTextRequest"},"ComparisonOperator":{"type":"object","title":"ComparisonOperator"},"ConnectorConnectionStatus":{"properties":{"latest_updated":{"type":"string","format":"date-time","title":"Latest Updated"},"files_indexed":{"type":"integer","title":"Files Indexed"},"creation_date":{"type":"string","format":"date-time","title":"Creation Date"},"status":{"$ref":"#/components/schemas/ParagonSyncStatus"},"last_synced_at":{"type":"string","title":"Last Synced At"}},"type":"object","required":["files_indexed","creation_date","status"],"title":"ConnectorConnectionStatus"},"ConnectorsDataSources":{"properties":{"data_sources":{"items":{"$ref":"#/components/schemas/DataSourceMetadata"},"type":"array","title":"Data Sources"}},"type":"object","required":["data_sources"],"title":"ConnectorsDataSources"},"ConnectorsStatus":{"properties":{"created_at":{"type":"string","title":"Created At"},"workflow_status":{"$ref":"#/components/schemas/ConnectorsWorkflowStatus"},"files_successfully_uploaded":{"type":"integer","title":"Files Successfully Uploaded"},"failed_uploaded_files":{"type":"integer","title":"Failed Uploaded Files"}},"type":"object","required":["created_at","workflow_status","files_successfully_uploaded","failed_uploaded_files"],"title":"ConnectorsStatus"},"ConnectorsSyncParams":{"properties":{"token":{"type":"string","title":"Token"},"data_source":{"type":"string","title":"Data Source"},"organization_id":{"type":"string","title":"Organization Id"},"pipeline":{"type":"string","title":"Pipeline"},"configuration":{"type":"object","title":"Configuration"},"configuration_name":{"type":"string","title":"Configuration Name"}},"type":"object","required":["token","data_source","organization_id","pipeline"],"title":"ConnectorsSyncParams"},"ConnectorsToken":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"ConnectorsToken"},"ConnectorsWorkflowStatus":{"enum":["IN_PROGRESS","PARTIALLY_COMPLETED","FAILED","SUCCEEDED"],"title":"ConnectorsWorkflowStatus","description":"An enumeration."},"CreateAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"avatar":{"type":"string","title":"Avatar"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["name"],"title":"CreateAssistantRequest"},"CreateMCPStorageRequest":{"properties":{"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_value":{"type":"string","title":"Auth Value"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["server_url","server_label"],"title":"CreateMCPStorageRequest"},"CreateMaestroRunsPayload":{"properties":{"input":{"anyOf":[{"items":{"$ref":"#/components/schemas/Message"},"type":"array"},{"type":"string"}],"title":"Input"},"output_type":{"type":"object","title":"Output Type"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"context":{"type":"object","title":"Context"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__Requirement"},"type":"array","title":"Requirements"},"budget":{"type":"string","enum":["low","medium","high"],"title":"Budget"},"verbose":{"type":"boolean","title":"Verbose","default":false},"include":{"items":{"type":"string"},"type":"array","title":"Include"},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"assistant_id":{"type":"string","title":"Assistant Id"},"variant":{"type":"string","enum":["main","ingestion"],"title":"Variant","default":"main"},"custom_retrieval_configs":{"items":{"type":"object"},"type":"array","title":"Custom Retrieval Configs"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"}},"type":"object","required":["input"],"title":"CreateMaestroRunsPayload"},"CreateOrganizationSchemaRequest":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_object":{"type":"object","title":"Schema Object"},"run_classification":{"type":"boolean","title":"Run Classification","default":false}},"type":"object","required":["schema_name","schema_object"],"title":"CreateOrganizationSchemaRequest"},"CreatePlanPayload":{"properties":{"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"}},"type":"object","required":["code"],"title":"CreatePlanPayload"},"CreateRoutePayload":{"properties":{"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["plan_id","name","description","examples"],"title":"CreateRoutePayload"},"CreateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","required":["secret_name","secret_value"],"title":"CreateSecretPayload"},"DataSourceMetadata":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"},"icon":{"type":"string","title":"Icon"},"connected":{"type":"boolean","title":"Connected"}},"type":"object","required":["name","type","description","icon","connected"],"title":"DataSourceMetadata"},"DeleteAssistantResponse":{"properties":{"object":{"type":"string","title":"Object","default":"assistant"},"deleted":{"type":"boolean","title":"Deleted","default":true},"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteAssistantResponse"},"DeleteMCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteMCPStorageResponse"},"Demo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["id","name","visibility","status","ui_component_name"],"title":"Demo"},"DemoCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["name","visibility","status","ui_component_name"],"title":"DemoCreate"},"DemoStatus":{"enum":["active","inactive"],"title":"DemoStatus","description":"An enumeration."},"DemoUpdate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","title":"DemoUpdate"},"DemoVisibility":{"enum":["public","private"],"title":"DemoVisibility","description":"An enumeration."},"DetectSchemaRequest":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentReference"},"type":"array","title":"Documents"},"queries":{"items":{"type":"string"},"type":"array","title":"Queries"}},"type":"object","required":["documents"],"title":"DetectSchemaRequest"},"DetectSchemaResponse":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"}},"type":"object","required":["schema_name","schema_definition"],"title":"DetectSchemaResponse"},"DocumentReference":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["document_id","name"],"title":"DocumentReference"},"DocumentSchema":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"content":{"type":"string","title":"Content"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata","default":{}}},"type":"object","required":["content"],"title":"DocumentSchema"},"DownloadModifiedDocumentRequest":{"properties":{"content":{"type":"string","title":"Content"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["content","filename"],"title":"DownloadModifiedDocumentRequest"},"FileResponse":{"properties":{"fileId":{"type":"string","format":"uuid","title":"Fileid","description":"The unique identifier of the file, generated by AI21.\n"},"name":{"type":"string","title":"Name","description":"The name of the file. This is the local file name from when the file was\nuploaded. It cannot be modified.\n"},"path":{"type":"string","title":"Path","description":"An arbitrary file-path-like string to indicate the content of a file. This has\nnothing to do with the location of the file in storage or on disk, and is only\nanother label that you can assign to the file in path-like format to help you\norganize the contents of the file or filter queries against your files. Example\npaths might be `pets/fish` or `pets/dogs`. Then, when searching your library,\nyou can filter files by the full path or path prefix. So to search only files\nin the \"dog folder\", filter by the path `/pets/dogs`. To search all files in\nthe \"pet folder\", filter your search by the path `pets/` when searching by path.\nThere isn't a restriction on whether a path must start or end with a / mark, but\nbe consistent in your usage, and all matches are prefix matching, not substring\nmatching. So filtering by `dog/` matches `dog/` and `dog/setter` but not `pets/dog/`.\n"},"fileType":{"type":"string","title":"Filetype","description":"The file type. See the file upload method to learn what file types are supported.\n"},"sizeBytes":{"type":"integer","title":"Sizebytes","description":"The size of the file, in bytes."},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any string labels you have associated with the file. You can apply arbitrary\nstring labels to your files and limit queries to files with one or more labels.\nSimilar to paths, but labels do not prefix match. Labels are case-sensitive.\nThere can be a maximum of 20 unique labels per account.\n"},"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"createdBy":{"type":"string","format":"uuid","title":"Createdby","description":"An internal identifier of the user who uploaded the file.\n"},"creationDate":{"type":"string","format":"date","title":"Creationdate","description":"The date when the file was uploaded."},"lastUpdated":{"type":"string","format":"date","title":"Lastupdated","description":"When the file data or metadata was last changed."},"status":{"type":"string","title":"Status","description":"File status. One of the following values: \"DB_RECORD_CREATED\",\n\"UPLOADED\", \"UPLOAD_FAILED\", \"PROCESSED\", \"PROCESSING_FAILED\"\n"},"dataSource":{"type":"string","title":"Datasource"}},"type":"object","required":["fileId","name","fileType","sizeBytes","createdBy","creationDate","lastUpdated","status"],"title":"FileResponse"},"FileSearchToolResource":{"properties":{"type":{"type":"string","enum":["file_search"],"title":"Type","default":"file_search"},"retrieval_similarity_threshold":{"type":"number","title":"Retrieval Similarity Threshold"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"labels_filter_mode":{"type":"string","enum":["AND","OR"],"title":"Labels Filter Mode","default":"AND"},"labels_filter":{"$ref":"#/components/schemas/QueryFilter"},"file_ids":{"items":{"type":"string"},"type":"array","title":"File Ids"},"retrieval_strategy":{"allOf":[{"$ref":"#/components/schemas/RetrievalStrategy"}],"default":"segments"},"max_neighbors":{"type":"integer","title":"Max Neighbors"},"path":{"type":"string","title":"Path"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"hybrid_search_alpha":{"type":"number","title":"Hybrid Search Alpha","default":1},"use_two_step_embedders":{"type":"boolean","title":"Use Two Step Embedders","default":false}},"type":"object","title":"FileSearchToolResource"},"FileStatus":{"type":"string","enum":["DB_RECORD_CREATED","UPLOADED","UPLOAD_FAILED","PROCESSED","PROCESSING_FAILED"],"title":"FileStatus","description":"An enumeration."},"FilesUpdateRequest":{"properties":{"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any labels to associate with this file. Separate multiple labels with commas. If\nprovided, will overwrite all existing labels.\n"}},"type":"object","title":"FilesUpdateRequest"},"FunctionToolDefinition":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/ToolParameters"}},"type":"object","required":["name"],"title":"FunctionToolDefinition"},"GenerateAssistantRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"avatar":{"type":"string","title":"Avatar"}},"type":"object","required":["prompt"],"title":"GenerateAssistantRequest"},"GenerateAssistantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"},"custom_tool_needed":{"additionalProperties":{"type":"string"},"type":"object","title":"Custom Tool Needed"},"recommended_files":{"items":{"type":"string"},"type":"array","title":"Recommended Files"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"GenerateAssistantResponse"},"HTTPToolEndpoint":{"properties":{"url":{"type":"string","title":"Url"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["url"],"title":"HTTPToolEndpoint"},"HTTPToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/HTTPToolFunctionParameters"}},"type":"object","required":["name","description","parameters"],"title":"HTTPToolFunction"},"HTTPToolFunctionParamProperties":{"properties":{"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"}},"type":"object","required":["type","description"],"title":"HTTPToolFunctionParamProperties"},"HTTPToolFunctionParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","default":"object"},"properties":{"additionalProperties":{"$ref":"#/components/schemas/HTTPToolFunctionParamProperties"},"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required"},"additionalProperties":{"type":"boolean","title":"Additionalproperties","default":false}},"type":"object","required":["properties","required"],"title":"HTTPToolFunctionParameters"},"HTTPToolResource":{"properties":{"type":{"type":"string","enum":["http"],"title":"Type","default":"http"},"function":{"$ref":"#/components/schemas/HTTPToolFunction"},"endpoint":{"$ref":"#/components/schemas/HTTPToolEndpoint"}},"type":"object","required":["function","endpoint"],"title":"HTTPToolResource"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IgnestionBatchStatusCount":{"properties":{"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["status","count"],"title":"IgnestionBatchStatusCount"},"IngestionBatchStatusResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id","description":"The UUID of the batch"},"total_documents":{"type":"integer","title":"Total Documents","description":"Total number of documents in the batch"},"statuses":{"items":{"$ref":"#/components/schemas/IgnestionBatchStatusCount"},"type":"array","title":"Statuses","description":"List of document counts by status"}},"type":"object","required":["batch_id","total_documents","statuses"],"title":"IngestionBatchStatusResponse"},"JambaExecuteRequest":{"properties":{"content":{"type":"string","title":"Content"},"task":{"type":"string","title":"Task"},"prompt":{"type":"string","title":"Prompt"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["content","task","prompt"],"title":"JambaExecuteRequest"},"LibrarySearchRequest":{"properties":{"query":{"type":"string","title":"Query"},"maxSegments":{"type":"integer","title":"Maxsegments"},"path":{"type":"string","title":"Path"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"labels_filter":{"$ref":"#/components/schemas/QueryFilter"},"labels_filter_mode":{"type":"string","enum":["AND","OR"],"title":"Labels Filter Mode","default":"AND"},"fileIds":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Fileids"},"retrievalStrategy":{"allOf":[{"$ref":"#/components/schemas/RetrievalStrategy"}],"default":"segments"},"maxNeighbors":{"type":"integer","title":"Maxneighbors","default":1},"retrievalSimilarityThreshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Retrievalsimilaritythreshold"},"hybridSearchAlpha":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Hybridsearchalpha"}},"type":"object","required":["query"],"title":"LibrarySearchRequest","description":"This class is to be used as a common class to all Studio API requests payloads"},"ListAssistantsResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListAssistantsResponse"},"ListMCPsStorageResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MCPStorageResponse"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListMCPsStorageResponse"},"ListPlansResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Plan"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListPlansResponse"},"ListRoutesResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantRoute"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListRoutesResponse"},"LogicalOperator":{"additionalProperties":{"items":{"type":"object"},"type":"array"},"type":"object","title":"LogicalOperator"},"Logprobs":{"properties":{"content":{"items":{"$ref":"#/components/schemas/LogprobsData"},"type":"array","title":"Content"}},"type":"object","required":["content"],"title":"Logprobs"},"LogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"},"top_logprobs":{"items":{"$ref":"#/components/schemas/TopLogprobsData"},"type":"array","title":"Top Logprobs"}},"type":"object","required":["token","logprob"],"title":"LogprobsData"},"MCPDefinition":{"properties":{"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["server_url"],"title":"MCPDefinition"},"MCPDiscoveryResponse":{"properties":{"mcp_definition":{"$ref":"#/components/schemas/MCPDefinition"},"tools":{"items":{"$ref":"#/components/schemas/MCPTool"},"type":"array","title":"Tools"}},"type":"object","required":["mcp_definition","tools"],"title":"MCPDiscoveryResponse"},"MCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_secret_key":{"type":"string","title":"Auth Secret Key"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["id","server_url","server_label","organization_id","user_id"],"title":"MCPStorageResponse"},"MCPTool":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"inputSchema":{"type":"object","title":"Inputschema"}},"type":"object","required":["name","inputSchema"],"title":"MCPTool"},"MCPToolResource":{"properties":{"type":{"type":"string","enum":["mcp"],"title":"Type","default":"mcp"},"server_label":{"type":"string","title":"Server Label"},"server_url":{"type":"string","title":"Server Url"},"headers":{"type":"object","title":"Headers"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"mcp_id":{"type":"string","title":"Mcp Id"}},"type":"object","title":"MCPToolResource"},"MaestroRunError":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MaestroRunError"},"MaestroRunResult":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"status":{"type":"string","enum":["completed","failed","in_progress","requires_action"],"title":"Status"},"result":{"title":"Result"},"data_sources":{"type":"object","title":"Data Sources"},"requirements_result":{"type":"object","title":"Requirements Result"},"error":{"$ref":"#/components/schemas/MaestroRunError"}},"type":"object","required":["id","status"],"title":"MaestroRunResult"},"MarkdownRequest":{"properties":{"text":{"type":"string","title":"Text","description":"All section answers concatenated"}},"type":"object","required":["text"],"title":"MarkdownRequest"},"Message":{"properties":{"role":{"type":"string","enum":["assistant","user"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"Message"},"MockResponseConfig":{"properties":{"response_delay_seconds":{"type":"number","minimum":0.0,"title":"Response Delay Seconds","default":1},"stream_response_delay_between_deltas_seconds":{"type":"number","minimum":0.0,"title":"Stream Response Delay Between Deltas Seconds","default":0.1}},"type":"object","title":"MockResponseConfig","include_in_schema":false},"ModelInfo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"},"updated":{"type":"string","title":"Updated"},"context_length":{"type":"integer","title":"Context Length"},"quantization":{"$ref":"#/components/schemas/ModelQuantization"},"max_completion_tokens":{"type":"integer","title":"Max Completion Tokens"},"pricing":{"$ref":"#/components/schemas/ModelPricing"}},"type":"object","required":["id","name","updated","context_length","quantization","max_completion_tokens","pricing"],"title":"ModelInfo"},"ModelName":{"type":"string","enum":["jamba-mini","jamba-large","jamba-large-1.7","jamba-large-1.7-2025-07","jamba-mini-2","jamba-mini-2-2026-01"],"title":"ModelName","description":"An enumeration."},"ModelPricing":{"properties":{"prompt":{"type":"string","title":"Prompt"},"completion":{"type":"string","title":"Completion"}},"type":"object","required":["prompt","completion"],"title":"ModelPricing"},"ModelQuantization":{"type":"string","enum":["FP8","experts_int8"],"title":"ModelQuantization","description":"An enumeration."},"ModelsInfoResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelsInfoResponse"},"ModifyAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"$ref":"#/components/schemas/RunOptimization"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"$ref":"#/components/schemas/BudgetLevel"},"visibility":{"$ref":"#/components/schemas/Visibility"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","title":"ModifyAssistantRequest"},"OrgSchema":{"properties":{"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"},"table_stats":{"type":"object","title":"Table Stats"}},"type":"object","required":["organization_id","schema_name","schema_definition","table_stats"],"title":"OrgSchema"},"OrgSchemas":{"properties":{"schemas":{"items":{"$ref":"#/components/schemas/OrgSchema"},"type":"array","title":"Schemas"}},"type":"object","required":["schemas"],"title":"OrgSchemas"},"ParagonSyncStatus":{"type":"string","enum":["ACTIVE","IDLE","ERRORED","PAUSED"],"title":"ParagonSyncStatus","description":"An enumeration."},"Plan":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","code","assistant_id"],"title":"Plan"},"QueryFilter":{"anyOf":[{"$ref":"#/components/schemas/ComparisonOperator"},{"$ref":"#/components/schemas/LogicalOperator"},{"additionalProperties":{"$ref":"#/components/schemas/ComparisonOperator"},"type":"object"}],"title":"QueryFilter"},"RFIResponseSection":{"properties":{"header":{"type":"string","title":"Header","description":"Exact or closest RFI heading for the section"},"description":{"type":"string","title":"Description","description":"≤350-character directive listing everything to include in that section"},"generated_content":{"type":"string","title":"Generated Content","description":"Generated content for this section based on company files"}},"type":"object","required":["header","description"],"title":"RFIResponseSection","description":"Model for a single RFI response section."},"RequirementItem":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"RequirementItem"},"RequirementsGenerationRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"RequirementsGenerationRequest"},"RequirementsGenerationResponse":{"properties":{"requirements":{"items":{"$ref":"#/components/schemas/RequirementItem"},"type":"array","title":"Requirements"}},"type":"object","required":["requirements"],"title":"RequirementsGenerationResponse"},"ResponseFormat":{"properties":{"type":{"type":"string","enum":["text","json_object"],"title":"Type"}},"type":"object","required":["type"],"title":"ResponseFormat"},"RetrievalStrategy":{"type":"string","enum":["segments","default","add_neighbors","full_doc"],"title":"RetrievalStrategy","description":"An enumeration."},"RunAssistantRequest":{"properties":{"input":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","title":"Input"},"verbose":{"type":"boolean","title":"Verbose","default":false},"output_type":{"type":"object","title":"Output Type"},"include":{"items":{"type":"string"},"type":"array","title":"Include","default":["data_sources","requirements_result","requirements_result.metadata"]},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"}},"type":"object","required":["input"],"title":"RunAssistantRequest"},"RunOptimization":{"enum":["cost","latency"],"title":"RunOptimization","description":"An enumeration."},"SecretResponse":{"properties":{"secret_id":{"type":"string","title":"Secret Id"},"secret_key":{"type":"string","title":"Secret Key"}},"type":"object","required":["secret_id","secret_key"],"title":"SecretResponse"},"StarterQuestion":{"properties":{"title":{"type":"string","title":"Title"},"prompt":{"type":"string","title":"Prompt"}},"type":"object","required":["title","prompt"],"title":"StarterQuestion"},"SystemMessage":{"properties":{"role":{"type":"string","enum":["system"],"title":"Role","default":"system","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"SystemMessage"},"ThreadNameGenerationRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"ThreadNameGenerationRequest"},"ThreadNameGenerationResponse":{"properties":{"thread_name":{"type":"string","title":"Thread Name"}},"type":"object","required":["thread_name"],"title":"ThreadNameGenerationResponse"},"ToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"type":{"type":"string","enum":["function"],"title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/ToolFunction"}},"type":"object","required":["id","function"],"title":"ToolCall"},"ToolCallDelta":{"properties":{"index":{"type":"integer","title":"Index"},"function":{"$ref":"#/components/schemas/ToolFunctionDelta"}},"type":"object","required":["index","function"],"title":"ToolCallDelta"},"ToolCallDeltaStart":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"index":{"type":"integer","title":"Index"},"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/ToolFunctionDeltaStart"}},"type":"object","required":["id","index","type","function"],"title":"ToolCallDeltaStart"},"ToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["name","arguments"],"title":"ToolFunction"},"ToolFunctionDelta":{"properties":{"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["arguments"],"title":"ToolFunctionDelta"},"ToolFunctionDeltaStart":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ToolFunctionDeltaStart"},"ToolMessage":{"properties":{"role":{"type":"string","enum":["tool"],"title":"Role","default":"tool","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_call_id":{"type":"string","title":"Tool Call Id"}},"type":"object","required":["content","tool_call_id"],"title":"ToolMessage"},"ToolParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","description":"Type of the parameter schema, only `object` is supported","default":"object"},"properties":{"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required","description":"List of required properties"}},"type":"object","required":["properties"],"title":"ToolParameters"},"TopLogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"}},"type":"object","required":["token","logprob"],"title":"TopLogprobsData"},"UpdateMCPStorageRequest":{"properties":{"server_label":{"type":"string","title":"Server Label"}},"type":"object","required":["server_label"],"title":"UpdateMCPStorageRequest"},"UpdateRoutePayload":{"properties":{"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["description"],"title":"UpdateRoutePayload"},"UpdateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","title":"UpdateSecretPayload"},"UploadMode":{"type":"string","enum":["immediate","batch"],"title":"UploadMode","description":"An enumeration."},"UsageInfo":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt for this request. Note that the prompt token\nincludes the entire message history, plus extra tokens needed by the system\nwhen combining the list of prompt messages into a single message, as\nrequired by the model. The number of extra tokens is typically proportional\nto the number of messages in the thread, and should be relatively small.\n"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the response message."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"`prompt_tokens` + `completion_tokens`.\n"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"UsageInfo"},"UserMessage":{"properties":{"role":{"type":"string","enum":["user"],"title":"Role","default":"user","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"UserMessage"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationResult":{"properties":{"is_valid":{"type":"boolean","title":"Is Valid"},"message":{"type":"string","title":"Message"},"details":{"type":"string","title":"Details"}},"type":"object","required":["is_valid"],"title":"ValidationResult"},"Visibility":{"enum":["public","private"],"title":"Visibility","description":"An enumeration."},"WebSearchToolResource":{"properties":{"type":{"type":"string","enum":["web_search"],"title":"Type","default":"web_search"},"urls":{"items":{"type":"string"},"type":"array","title":"Urls"},"fallback_to_web":{"type":"boolean","title":"Fallback To Web"},"query_suffix":{"type":"string","title":"Query Suffix"},"rephrase_query":{"type":"boolean","title":"Rephrase Query"},"use_cached_pages":{"type":"boolean","title":"Use Cached Pages","default":false}},"type":"object","title":"WebSearchToolResource"},"WebsiteConnectorCreateConfigPayload":{"properties":{"name":{"type":"string","title":"Name"},"extract_linked_files":{"type":"boolean","title":"Extract Linked Files","default":false},"wait_for_dynamic_content":{"type":"boolean","title":"Wait For Dynamic Content","default":false},"skip_url_patterns":{"items":{"type":"string"},"type":"array","title":"Skip Url Patterns"},"target_file_extensions":{"items":{"type":"string"},"type":"array","title":"Target File Extensions"},"localization":{"type":"string","title":"Localization"}},"type":"object","required":["name","skip_url_patterns","target_file_extensions"],"title":"WebsiteConnectorCreateConfigPayload"},"WebsiteConnectorIngestUrlPayload":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"WebsiteConnectorIngestUrlPayload"},"WebsiteConnectorIngestWebsitePayload":{"properties":{"sitemap_url":{"type":"string","title":"Sitemap Url"},"client_config":{"type":"string","title":"Client Config"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"}},"type":"object","required":["sitemap_url"],"title":"WebsiteConnectorIngestWebsitePayload"},"WebsiteConnectorPayload":{"properties":{"type":{"type":"string","enum":["sitemap","urls"],"title":"Type"},"value":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Value"}},"type":"object","required":["type","value"],"title":"WebsiteConnectorPayload"},"WebsiteConnectorRetryIngestWebsitePayload":{"properties":{"website_id":{"type":"string","format":"uuid","title":"Website Id"}},"type":"object","required":["website_id"],"title":"WebsiteConnectorRetryIngestWebsitePayload"},"WorkflowConfig":{"properties":{"endpoint_url":{"type":"string","title":"Endpoint Url"},"headers":{"type":"object","title":"Headers"},"additional_params":{"type":"object","title":"Additional Params"}},"type":"object","required":["endpoint_url"],"title":"WorkflowConfig"},"WorkspaceModelResponse":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"provider":{"type":"string","title":"Provider"},"internal":{"type":"boolean","title":"Internal","default":false}},"type":"object","required":["name","model_type"],"title":"WorkspaceModelResponse"},"WorkspaceModelUpdate":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"}},"type":"object","title":"WorkspaceModelUpdate"},"WorkspaceModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/WorkspaceModelResponse"},"type":"array","title":"Models"}},"type":"object","required":["models"],"title":"WorkspaceModelsResponse"},"language_studio_api_server__data_types__assistant__Requirement":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"type":{"type":"string","title":"Type"}},"type":"object","title":"Requirement"},"language_studio_api_server__data_types__chat__ToolDefinition":{"properties":{"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/FunctionToolDefinition"}},"type":"object","required":["type","function"],"title":"ToolDefinition"},"language_studio_api_server__data_types__execution_engine__Requirement":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"is_mandatory":{"type":"boolean","title":"Is Mandatory"}},"type":"object","required":["name","description"],"title":"Requirement"},"language_studio_api_server__data_types__execution_engine__ToolDefinition":{"oneOf":[{"$ref":"#/components/schemas/HTTPToolResource"},{"$ref":"#/components/schemas/MCPToolResource"},{"$ref":"#/components/schemas/FileSearchToolResource"},{"$ref":"#/components/schemas/WebSearchToolResource"}],"title":"ToolDefinition","discriminator":{"propertyName":"type","mapping":{"http":"#/components/schemas/HTTPToolResource","mcp":"#/components/schemas/MCPToolResource","file_search":"#/components/schemas/FileSearchToolResource","web_search":"#/components/schemas/WebSearchToolResource"}}}}}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"AI21 Studio API","description":"Access our powerful language models using an API that makes you smile","version":"1.0.0"},"paths":{"/studio/v1/chat/files/convert":{"post":{"summary":"Convert Document File","operationId":"convert_document_file_studio_v1_chat_files_convert_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_convert_document_file_studio_v1_chat_files_convert_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/chat/completions":{"post":{"tags":["Jamba Complete"],"summary":"Studio Chat Complete","description":"This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).\nThis is a foundation model that supports both single-turn (question answering,\ntext completion) and multi-turn (chat style) interactions.\n\nYou can optionally stream results if you want to get the response as each\ntoken is generated, rather than waiting for the entire response.","operationId":"v1_chat_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletion"},{"items":{"$ref":"#/components/schemas/ChatCompletionVllmStreamingMessage"},"type":"array"}],"title":"Response V1 Chat Complete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files":{"get":{"tags":["Library management"],"summary":"Get Workspace Files","description":"Get metadata about a specific file by file ID. The file ID is generated by\nAI21 when you upload the file.","operationId":"v1_library_management","parameters":[{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"},{"required":false,"schema":{"type":"string","title":"Path"},"name":"path","in":"query"},{"required":false,"schema":{"$ref":"#/components/schemas/FileStatus"},"name":"status","in":"query"},{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Label"},"name":"label","in":"query"},{"required":false,"schema":{"type":"integer","title":"Limit","default":500000},"name":"limit","in":"query"},{"required":false,"schema":{"type":"integer","title":"Offset"},"name":"offset","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FileResponse"},"type":"array","title":"Response V1 Library Management"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Library management"],"summary":"Upload Workspace File","description":"Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).\nYou can assign metadata to your files to limit searches to specific files by file metadata.\nThere is no bulk upload method; files must be loaded one at a time.\n\n- **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.\n- **Max library size:** 1 GB total size. No limit to individual file size.\n- **Supported file types:** PDF, DocX, HTML, TXT","operationId":"v1_library_upload","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_library_upload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}":{"get":{"tags":["Library management"],"summary":"Get File By Id","description":"Retrieve a list of documents in the user's library. Optionally specify a\nfilter to find only files with matching labels or paths. This method\nreturns only metadata about files; to download a file, call\n`GET .../files/{file_id}/download`\n\nWhen specifying qualifiers with your request, only files that match\n_all_ qualifiers will be returns. So, for example, if you specify\n`label='financial'` and `status='UPLOADED'`, only files with the label\n\"financial\" AND status UPLOADED will be returned.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Library management"],"summary":"Update File","description":"Update the specified parameters of a specific document in the user's library.\nThis operation currently supports updating the publicUrl and labels parameters.\n\n> **This operation overwrites the specified items with the new data you provide.**\n> If you wish to add new labels to the labels list without removing the existing ones,\n> you must submit a labels list that includes both the current and new labels.**\n>\n> For instance, if the current labels are \"Label A\" and \"Label B\", and you wish to\n> add \"New Label C\" and \"New Label D\" to the list, you must specify `\"labels\": [\"Label A\", \"Label B\", \"New Label C\", \"New Label D\"]`.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Library management"],"summary":"Delete File","description":"Delete the specified file from the library.\n\n**Restrictions**:\nFiles in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a 422 error.","operationId":"v1_library_delete","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/search":{"post":{"tags":["RAG Engine"],"summary":"Search","operationId":"v1_library_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibrarySearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets":{"get":{"tags":["Secrets"],"summary":"Get Secret List","operationId":"v1_secret_storage","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Secrets"],"summary":"Save Secret","operationId":"v1_secret_storage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Secrets"],"summary":"Delete Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets/{secret_id}":{"patch":{"tags":["Secrets"],"summary":"Update Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/batches/{batch_id}/status":{"get":{"tags":["RAG Engine"],"summary":"Get Batch Ingestion Status","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestionBatchStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/download":{"get":{"tags":["RAG Engine"],"summary":"Generate Documents Signed Url","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/parsed":{"get":{"tags":["RAG Engine"],"summary":"Download Parsed Document","description":"Download parsed document with Content-Disposition header for immediate download.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/tokens":{"post":{"summary":"Generate Org Token","operationId":"generate_org_token_studio_v1_connectors_connected_users__entity_id__tokens_post","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources":{"get":{"summary":"Get Org Data Sources Info","operationId":"get_org_data_sources_info_studio_v1_connectors_connected_users__entity_id__data_sources_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsDataSources"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/status":{"get":{"summary":"Get Data Source Status","operationId":"get_data_source_status_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Paragon Token"},"name":"paragon_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/connection-status":{"get":{"summary":"Get Connector Connection Status","operationId":"get_connector_connection_status_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__connection_status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Paragon Token"},"name":"paragon_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorConnectionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/workflows/{workflow_name}/run":{"post":{"summary":"Run Workflow","operationId":"run_workflow_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__workflows__workflow_name__run_post","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Workflow Name"},"name":"workflow_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/data-sources/syncs":{"post":{"summary":"Run Sync","operationId":"run_sync_studio_v1_connectors_connected_users_data_sources_syncs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsSyncParams"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website":{"get":{"summary":"Get Website Connector","operationId":"get_website_connector_studio_v1_connectors_website_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Post Website Connector","operationId":"post_website_connector_studio_v1_connectors_website_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website/{connector_id}":{"get":{"summary":"Get Website Connector By Id","operationId":"get_website_connector_by_id_studio_v1_connectors_website__connector_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Website Connector","operationId":"delete_website_connector_studio_v1_connectors_website__connector_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website/{connector_id}/sync":{"post":{"summary":"Sync Website","operationId":"sync_website_studio_v1_connectors_website__connector_id__sync_post","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/paragon/webhook":{"post":{"summary":"Forward Paragon Webhook","operationId":"forward_paragon_webhook_studio_v1_connectors_paragon_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/maestro/runs":{"post":{"summary":"Create Maestro Run","operationId":"v1_maestro_run","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMaestroRunsPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/maestro/runs/{execution_id}":{"get":{"summary":"Get Maestro Run","operationId":"v1_get_maestro_run","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos":{"get":{"summary":"List Demos","description":"List all available demos.","operationId":"list_demos_studio_v1_demos_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Demo"},"type":"array","title":"Response List Demos Studio V1 Demos Get"}}}}}},"post":{"summary":"Create Demo","description":"Create a new demo.","operationId":"create_demo_studio_v1_demos_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/{demo_id}":{"get":{"summary":"Get Demo","description":"Get a specific demo by ID.","operationId":"get_demo_studio_v1_demos__demo_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Demo","description":"Update an existing demo.","operationId":"update_demo_studio_v1_demos__demo_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Demo","description":"Delete a demo.","operationId":"delete_demo_studio_v1_demos__demo_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/parse-pdf":{"post":{"summary":"Parse Pdf","description":"Parse a PDF file and return its contents.","operationId":"parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Parse Pdf Studio V1 Demos Document Modifier Parse Pdf Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/get-parsed-file":{"get":{"summary":"Get Parsed File","description":"Get the parsed file from the document modifier.","operationId":"get_parsed_file_studio_v1_demos_document_modifier_get_parsed_file_get","parameters":[{"required":true,"schema":{"type":"string","title":"File Name"},"name":"file_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Parsed File Studio V1 Demos Document Modifier Get Parsed File Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/compare-text":{"post":{"summary":"Compare Text","description":"Compare text in a document file against a reference text.","operationId":"compare_text_studio_v1_demos_document_modifier_compare_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompareTextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Compare Text Studio V1 Demos Document Modifier Compare Text Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/download":{"post":{"summary":"Download Modified Document","description":"Download a modified document.","operationId":"download_modified_document_studio_v1_demos_document_modifier_download_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadModifiedDocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/jamba-execute":{"post":{"summary":"Jamba Execute","description":"Execute a Jamba request.","operationId":"jamba_execute_studio_v1_demos_document_modifier_jamba_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JambaExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Jamba Execute Studio V1 Demos Document Modifier Jamba Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/upload-check-compliance":{"post":{"summary":"Upload Check Compliance","description":"Check compliance of a document file against regulatory requirements.","operationId":"upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Upload Check Compliance Studio V1 Demos Regulations Upload Check Compliance Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/vector-store/{vector_store_id}":{"get":{"summary":"Get Vector Store","description":"Get a vector store by ID.","operationId":"get_vector_store_studio_v1_demos_regulations_vector_store__vector_store_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Vector Store Id"},"name":"vector_store_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/generate-response-pdf":{"post":{"summary":"Combine section answers ➜ styled PDF for download","operationId":"generate_response_pdf_studio_v1_demos_rfi_generate_response_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/process-rfi":{"post":{"summary":"Process Rfi Document","operationId":"process_rfi_document_studio_v1_demos_rfi_process_rfi_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RFIResponseSection"},"type":"array","title":"Response Process Rfi Document Studio V1 Demos Rfi Process Rfi Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/file-url/{file_id}":{"get":{"summary":"Get File Url","operationId":"get_file_url_studio_v1_demos_scraper_file_url__file_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"File Id"},"name":"file_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Api Key"},"name":"api_key","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/can-iframe":{"get":{"summary":"Can Iframe","operationId":"can_iframe_studio_v1_demos_scraper_can_iframe_get","parameters":[{"required":true,"schema":{"type":"string","title":"Url"},"name":"url","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Can Iframe Studio V1 Demos Scraper Can Iframe Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-url":{"post":{"tags":["Website Connector"],"summary":"Connect Website","operationId":"v1_website_connector_ingest_url","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestUrlPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/url-status":{"get":{"tags":["Website Connector"],"summary":"Get Url Status","operationId":"v1_website_connector_get_url_status","parameters":[{"required":true,"schema":{"type":"string","title":"Url Id"},"name":"url_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-website":{"post":{"tags":["Website Connector"],"summary":"Ingest Website","operationId":"v1_website_connector_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/website-status":{"get":{"tags":["Website Connector"],"summary":"Get Website Status","operationId":"v1_website_connector_get_website_status","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Website Id"},"name":"website_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/retry-ingest-website":{"post":{"tags":["Website Connector"],"summary":"Retry Ingest Website","operationId":"v1_website_connector_retry_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorRetryIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/client-config":{"get":{"tags":["Website Connector"],"summary":"Get Client Config","operationId":"v1_website_connector_get_config","parameters":[{"required":true,"schema":{"type":"string","title":"Config Name"},"name":"config_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Website Connector"],"summary":"Create Client Config","operationId":"v1_website_connector_create_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorCreateConfigPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas":{"get":{"summary":"Get Organization Schemas","operationId":"get_organization_schemas_studio_v1_structured_rag_organizations__organization_id__schemas_get","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSchemas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Organization Schema","operationId":"create_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schema-detection":{"post":{"summary":"Detect Schema","operationId":"detect_schema_studio_v1_structured_rag_organizations__organization_id__schema_detection_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas/{schema_name}":{"delete":{"summary":"Delete Organization Schema","operationId":"delete_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas__schema_name__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Schema Name"},"name":"schema_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/generation/requirements":{"post":{"summary":"Generate Requirements","operationId":"v1_studio_api_generation_requirements","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/generation/thread-name":{"post":{"summary":"Generate Thread Name","operationId":"v1_studio_api_generation_thread_name","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadNameGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadNameGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/models":{"get":{"summary":"Get Models Info","operationId":"v1_list_models_info","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsInfoResponse"}}}}}}},"/studio/v1/assistants":{"get":{"summary":"Get Assistants","operationId":"v1_list_assistants","parameters":[{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Workspace Ids"},"name":"workspace_ids","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAssistantsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Assistant","operationId":"v1_create_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/generate":{"post":{"summary":"Generate Assistant","operationId":"v1_generate_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}":{"get":{"summary":"Get Assistant","operationId":"v1_get_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Assistant","operationId":"v1_delete_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Assistant","operationId":"v1_modify_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/run":{"post":{"summary":"Run Assistant","operationId":"v1_run_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans":{"get":{"summary":"List Plans","operationId":"v1_list_plans","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPlansResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Plan","operationId":"v1_create_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans/{plan_id}":{"get":{"summary":"Get Plan","operationId":"v1_get_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Plan","operationId":"v1_modify_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes":{"get":{"summary":"Get Routes","operationId":"v1_list_routes","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRoutesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Route","operationId":"v1_create_route","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes/{route_id}":{"get":{"summary":"Get Route","operationId":"v1_get_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Route","operationId":"v1_delete_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Route","operationId":"v1_modify_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/validate_plan":{"post":{"summary":"Validate Plan","operationId":"v1_validate_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/executions/{execution_id}/explanations/steps":{"get":{"summary":"Get Step Explanations","description":"Get step explanations for an execution (cached or generated).\nSet force_regenerate=True to regenerate even if cached.","operationId":"get_step_explanations_studio_v1_executions__execution_id__explanations_steps_get","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Force Regenerate","default":false},"name":"force_regenerate","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/executions/{execution_id}/explanations/output":{"get":{"summary":"Get Output Explanation","description":"Get output explanation for an execution (cached or generated).\nSet force_regenerate=True to regenerate even if cached.","operationId":"get_output_explanation_studio_v1_executions__execution_id__explanations_output_get","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Force Regenerate","default":false},"name":"force_regenerate","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/discover":{"post":{"summary":"Mcp Tool Discovery","operationId":"mcp_tool_discovery_studio_v1_mcp_discover_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPDefinition"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage":{"get":{"summary":"List Mcp Storage","operationId":"list_mcp_storage_studio_v1_mcp_storage_get","parameters":[{"required":false,"schema":{"type":"string","format":"uuid","title":"Workspace Id"},"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMCPsStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Mcp Storage","operationId":"create_mcp_storage_studio_v1_mcp_storage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}":{"get":{"summary":"Get Mcp Storage","operationId":"get_mcp_storage_studio_v1_mcp_storage__mcp_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Mcp Storage","operationId":"delete_mcp_storage_studio_v1_mcp_storage__mcp_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Mcp Storage","operationId":"update_mcp_storage_studio_v1_mcp_storage__mcp_id__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}/assistants":{"get":{"summary":"Get Assistants By Mcp","operationId":"get_assistants_by_mcp_studio_v1_mcp_storage__mcp_id__assistants_get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantsByMcpResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models":{"get":{"summary":"Get Workspace Models By Organization Endpoint","operationId":"get_workspace_models_by_organization_endpoint_studio_v1_settings_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelsResponse"}}}}}}},"/studio/v1/settings/models/available":{"get":{"summary":"Get Available Models Endpoint","operationId":"get_available_models_endpoint_studio_v1_settings_models_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/settings/models/{name}/secrets":{"get":{"summary":"Get Workspace Model Secret Endpoint","operationId":"get_workspace_model_secret_endpoint_studio_v1_settings_models__name__secrets_get","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models/{name}":{"delete":{"summary":"Delete Workspace Model Endpoint","operationId":"delete_workspace_model_endpoint_studio_v1_settings_models__name__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Workspace Model Endpoint","operationId":"update_workspace_model_endpoint_studio_v1_settings_models__name__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag","operationId":"v1_solutions_tlv_municipality_convrag","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag Prefix Preview","operationId":"v1_solutions_tlv_municipality_preview_convrag","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications","operationId":"v1_solutions_fnac_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions","operationId":"v1_solutions_fnac_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications","operationId":"v1_solutions_fnac_v1_deprecated_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions","operationId":"v1_solutions_fnac_v1_deprecated_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications","operationId":"v1_solutions_fd_batches_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status","operationId":"v1_solutions_fd_batches_v1_classifications_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results","operationId":"v1_solutions_fd_batches_v1_classifications_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions","operationId":"v1_solutions_fd_batches_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status","operationId":"v1_solutions_fd_batches_v1_descriptions_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results","operationId":"v1_solutions_fd_batches_v1_descriptions_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_deprecated_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_deprecated_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_classifications_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_classifications_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_descriptions_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_descriptions_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict","operationId":"v1_solutions_fnac_aftersales_batch_predict","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status","operationId":"v1_solutions_fnac_aftersales_batch_predict_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict Prefix Preview","operationId":"v1_solutions_fnac_aftersales_preview_batch_predict","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status Prefix Preview","operationId":"v1_solutions_fnac_aftersales_preview_batch_predict_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/vidaa/summarize":{"post":{"summary":"Vidaa Summarize","operationId":"v1_solutions_vidaa_summarize","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/action-items":{"post":{"summary":"Vidaa Action Items","operationId":"v1_solutions_vidaa_action_items","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/sources":{"get":{"summary":"Vidaa Sources","operationId":"v1_solutions_vidaa_sources","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/feed-items":{"get":{"summary":"Vidaa Feed Items","operationId":"v1_solutions_vidaa_feed_items","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/subscribe":{"post":{"summary":"Vidaa Subscribe","operationId":"v1_solutions_vidaa_subscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/unsubscribe":{"post":{"summary":"Vidaa Unsubscribe","operationId":"v1_solutions_vidaa_unsubscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/subscriptions":{"get":{"summary":"Vidaa Subscriptions","operationId":"v1_solutions_vidaa_subscriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/scheduler-stats":{"get":{"summary":"Vidaa Scheduler Stats","operationId":"v1_solutions_vidaa_scheduler_stats","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/trigger-poll":{"post":{"summary":"Vidaa Trigger Poll","operationId":"v1_solutions_vidaa_trigger_poll","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/content/brief":{"post":{"summary":"Vidaa Content Brief","operationId":"v1_solutions_vidaa_content_brief","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/content/brief/scheduled":{"post":{"summary":"Vidaa Content Brief Scheduled","operationId":"v1_solutions_vidaa_content_brief_scheduled","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/content/brief/jobs":{"post":{"summary":"Vidaa Content Brief Jobs","operationId":"v1_solutions_vidaa_content_brief_jobs","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/content/brief/jobs/{job_id}":{"get":{"summary":"Vidaa Content Brief Jobs Status","operationId":"v1_solutions_vidaa_content_brief_jobs_status","parameters":[{"required":true,"schema":{"type":"string","title":"Job Id"},"name":"job_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/vidaa/content/subscribe":{"post":{"summary":"Vidaa Content Subscribe","operationId":"v1_solutions_vidaa_content_subscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/content/unsubscribe":{"post":{"summary":"Vidaa Content Unsubscribe","operationId":"v1_solutions_vidaa_content_unsubscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/content/subscriptions":{"get":{"summary":"Vidaa Content Subscriptions","operationId":"v1_solutions_vidaa_content_subscriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/api/messages":{"post":{"summary":"Vidaa Messages","operationId":"v1_solutions_vidaa_api_messages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/content/api/messages":{"post":{"summary":"Vidaa Content Messages","operationId":"v1_solutions_vidaa_content_api_messages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/api/messages":{"post":{"summary":"Vidaa Messages Preview","operationId":"v1_solutions_vidaa_preview_api_messages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/content/api/messages":{"post":{"summary":"Vidaa Content Messages Preview","operationId":"v1_solutions_vidaa_preview_content_api_messages","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/summarize":{"post":{"summary":"Vidaa Summarize Preview","operationId":"v1_solutions_vidaa_preview_summarize","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/action-items":{"post":{"summary":"Vidaa Action Items Preview","operationId":"v1_solutions_vidaa_preview_action_items","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/sources":{"get":{"summary":"Vidaa Sources Preview","operationId":"v1_solutions_vidaa_preview_sources","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/feed-items":{"get":{"summary":"Vidaa Feed Items Preview","operationId":"v1_solutions_vidaa_preview_feed_items","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/subscribe":{"post":{"summary":"Vidaa Subscribe Preview","operationId":"v1_solutions_vidaa_preview_subscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/unsubscribe":{"post":{"summary":"Vidaa Unsubscribe Preview","operationId":"v1_solutions_vidaa_preview_unsubscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/subscriptions":{"get":{"summary":"Vidaa Subscriptions Preview","operationId":"v1_solutions_vidaa_preview_subscriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/scheduler-stats":{"get":{"summary":"Vidaa Scheduler Stats Preview","operationId":"v1_solutions_vidaa_preview_scheduler_stats","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/trigger-poll":{"post":{"summary":"Vidaa Trigger Poll Preview","operationId":"v1_solutions_vidaa_preview_trigger_poll","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/content/brief":{"post":{"summary":"Vidaa Content Brief Preview","operationId":"v1_solutions_vidaa_preview_content_brief","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/content/brief/scheduled":{"post":{"summary":"Vidaa Content Brief Scheduled Preview","operationId":"v1_solutions_vidaa_preview_content_brief_scheduled","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/content/brief/jobs":{"post":{"summary":"Vidaa Content Brief Jobs Preview","operationId":"v1_solutions_vidaa_preview_content_brief_jobs","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/content/brief/jobs/{job_id}":{"get":{"summary":"Vidaa Content Brief Jobs Status Preview","operationId":"v1_solutions_vidaa_preview_content_brief_jobs_status","parameters":[{"required":true,"schema":{"type":"string","title":"Job Id"},"name":"job_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/vidaa/content/subscribe":{"post":{"summary":"Vidaa Content Subscribe Preview","operationId":"v1_solutions_vidaa_preview_content_subscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/content/unsubscribe":{"post":{"summary":"Vidaa Content Unsubscribe Preview","operationId":"v1_solutions_vidaa_preview_content_unsubscribe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/content/subscriptions":{"get":{"summary":"Vidaa Content Subscriptions Preview","operationId":"v1_solutions_vidaa_preview_content_subscriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/grant-compliance":{"post":{"summary":"Kirsh Grant Compliance","operationId":"v1_solutions_kirsh_grant_compliance","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/grant-metadata":{"post":{"summary":"Kirsh Grant Metadata","operationId":"v1_solutions_kirsh_grant_metadata","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/funding-and-categorization-check":{"post":{"summary":"Kirsh Funding And Categorization Check","operationId":"v1_solutions_kirsh_funding_and_categorization_check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/public-information-check/jobs":{"post":{"summary":"Kirsh Public Information Check Jobs","operationId":"kirsh_public_information_check_jobs_solutions_kirsh_public_information_check_jobs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/public-information-check/jobs/{job_id}":{"get":{"summary":"Kirsh Public Information Check Job","operationId":"kirsh_public_information_check_job_solutions_kirsh_public_information_check_jobs__job_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Job Id"},"name":"job_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/kirsh/public-information-check":{"post":{"summary":"Kirsh Public Information Check","operationId":"v1_solutions_kirsh_public_information_check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh-document-upload/process":{"post":{"summary":"Kirsh Document Upload Process","operationId":"v1_solutions_kirsh_document_upload_process","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/email-assistant":{"post":{"summary":"Kirsh Email Assistant","operationId":"v1_solutions_kirsh_email_assistant","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/grant-compliance":{"post":{"summary":"Kirsh Grant Compliance Prefix Preview","operationId":"v1_solutions_kirsh_preview_grant_compliance","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/grant-metadata":{"post":{"summary":"Kirsh Grant Metadata Prefix Preview","operationId":"v1_solutions_kirsh_preview_grant_metadata","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/funding-and-categorization-check":{"post":{"summary":"Kirsh Funding And Categorization Check Prefix Preview","operationId":"v1_solutions_kirsh_preview_funding_and_categorization_check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/public-information-check/jobs":{"post":{"summary":"Kirsh Public Information Check Jobs Prefix Preview","operationId":"kirsh_public_information_check_jobs_prefix_preview_solutions_preview_kirsh_public_information_check_jobs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/public-information-check/jobs/{job_id}":{"get":{"summary":"Kirsh Public Information Check Job Prefix Preview","operationId":"kirsh_public_information_check_job_prefix_preview_solutions_preview_kirsh_public_information_check_jobs__job_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Job Id"},"name":"job_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/kirsh/public-information-check":{"post":{"summary":"Kirsh Public Information Check Prefix Preview","operationId":"v1_solutions_kirsh_preview_public_information_check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh-document-upload/process":{"post":{"summary":"Kirsh Document Upload Process Prefix Preview","operationId":"v1_solutions_kirsh_preview_document_upload_process","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/email-assistant":{"post":{"summary":"Kirsh Email Assistant Prefix Preview","operationId":"v1_solutions_kirsh_preview_email_assistant","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/product-lookup":{"post":{"summary":"Claroty Product Lookup","operationId":"v1_solutions_claroty_product_lookup","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/suggest-vendor-model":{"post":{"summary":"Claroty Suggest Vendor Model","operationId":"v1_solutions_claroty_suggest_vendor_model","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Assistant":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"Assistant"},"AssistantBasicInfo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AssistantBasicInfo"},"AssistantMessage":{"properties":{"role":{"type":"string","enum":["assistant"],"title":"Role","default":"assistant","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls"},"reasoning_content":{"type":"string","title":"Reasoning Content"}},"type":"object","title":"AssistantMessage"},"AssistantRoute":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","plan_id","name","description","examples","assistant_id"],"title":"AssistantRoute"},"AssistantType":{"enum":["default","chat","maestro"],"title":"AssistantType","description":"An enumeration."},"AssistantsByMcpResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantBasicInfo"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"AssistantsByMcpResponse"},"AuthenticationType":{"type":"string","enum":["none","token-api","custom-header"],"title":"AuthenticationType","description":"An enumeration."},"Body_convert_document_file_studio_v1_chat_files_convert_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_convert_document_file_studio_v1_chat_files_convert_post"},"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"},"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"RFI document file (PDF supported)"},"budget":{"type":"string","title":"Budget","description":"Budget level: LOW, MEDIUM, or HIGH","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"},"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"budget":{"type":"string","title":"Budget","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"},"Body_v1_library_upload":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"path":{"type":"string","title":"Path"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"publicUrl":{"type":"string","title":"Publicurl"},"custom_configs":{"type":"string","title":"Custom Configs"},"upload_mode":{"allOf":[{"$ref":"#/components/schemas/UploadMode"}],"default":"immediate"},"batch_id":{"type":"string","format":"uuid","title":"Batch Id"},"data_source":{"type":"string","title":"Data Source"},"metadata":{"type":"string","title":"Metadata"}},"type":"object","required":["file"],"title":"Body_v1_library_upload"},"BudgetLevel":{"enum":["low","medium","high"],"title":"BudgetLevel","description":"An enumeration."},"ChatCompletion":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseChoice"},"type":"array","title":"Choices","description":"One or more responses, depending on the `n` parameter from the request.\n"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"The token counts for this request. Per-token billing is based on the\nprompt token and completion token counts and rates.\n"},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices","usage"],"title":"ChatCompletion","description":"Used for non-streaming responses. Streaming responses return `ChatCompletionVllmStreamingMessage`."},"ChatCompletionResponseChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Zero-based index of the message in the list of messages. Note that this might not\ncorrespond with the position in the response list.\n"},"message":{"$ref":"#/components/schemas/AssistantMessage","description":"The message generated by the model. Same structure as the request message, with `role` and `content` members.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"Why the message ended. Possible reasons:\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","message"],"title":"ChatCompletionResponseChoice","description":"A single possible response generated by the system. For non-streaming replies, There\ncan be multiple responses, depending on what `n` value you specified in the request.\n"},"ChatCompletionResponseDeltaChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Always zero in streamed responses."},"delta":{"anyOf":[{"$ref":"#/components/schemas/ChatStreamingFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingContentDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsDelta"}],"title":"Delta","description":"- **The first message** in the stream will be an object set to `{\"role\":\"assistant\"}`.\n- **Subsequent messages** will have an object `{\"content\": __token__}` with the generated token.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"One of the following string values:\n - `null`: All messages but the last will return null for `finish_reason`.\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","delta"],"title":"ChatCompletionResponseDeltaChoice"},"ChatCompletionVllmStreamingMessage":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseDeltaChoice"},"type":"array","title":"Choices","description":"The message"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"Included in the last message only. Total token counts for the message."},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices"],"title":"ChatCompletionVllmStreamingMessage","description":"Returned for streaming messages. Non-streaming responses return `ChatCompletion`."},"ChatRequest":{"properties":{"model":{"$ref":"#/components/schemas/ModelName","description":"The name of the model to use. Choose one of the following values:\n* `jamba-instruct-preview`\n"},"messages":{"items":{"oneOf":[{"$ref":"#/components/schemas/UserMessage"},{"$ref":"#/components/schemas/AssistantMessage"},{"$ref":"#/components/schemas/ToolMessage"},{"$ref":"#/components/schemas/SystemMessage"}],"discriminator":{"propertyName":"role","mapping":{"user":"#/components/schemas/UserMessage","assistant":"#/components/schemas/AssistantMessage","tool":"#/components/schemas/ToolMessage","system":"#/components/schemas/SystemMessage"}}},"type":"array","title":"Messages","description":"The previous messages in this chat, from oldest (index 0) to newest. Messages\nmust be alternating `user`/`assistant` messages, optionally starting with a `system`\nmessage. For single turn interactions, this should be an optional `system` message,\nand a single `user` message. Maximum total size for the list is about 256K tokens.\n"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__chat__ToolDefinition"},"type":"array","title":"Tools"},"n":{"type":"integer","title":"N","default":1,"description":"How many chat responses to generate. _Range: 1 – 16_ **Notes:**\n- If `n > 1`, setting `temperature=0` will fail because all answers are guaranteed to be duplicates.\n- `n` must be 1 when `stream = True`\n"},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096,"description":"The maximum number of tokens to allow for each generated response message. Typically\nthe best way to limit output length is by providing a length limit in the system\nprompt (for example, \"limit your answers to three sentences\"). _Range: 0 – 4096_\n"},"temperature":{"type":"number","title":"Temperature","description":"How much variation to provide in each answer. Setting this value to 0 guarantees the\nsame response to the same question every time. Setting a higher value encourages more\nvariation. Modifies the distribution from which tokens are sampled.\n[More information](https://docs.ai21.com/docs/sampling-from-language-models#temperature)\n_Range: 0.0 – 2.0_\n"},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","default":1,"description":"Limit the pool of next tokens in each step to the top N percentile of possible\ntokens, where 1.0 means the pool of all possible tokens, and 0.01 means the\npool of only the most likely next tokens. [More information]\n(https://docs.ai21.com/docs/sampling-from-language-models#topp) _Range: 0 \\<= value \\<=1.0_\n"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Stop","description":"End the message when the model generates one of these strings. The stop sequence\nis not included in the generated message. Each sequence can be up to 64K long, and\ncan contain newlines as `\\n` characters. Examples:\n- Single stop string with a word and a period: \"monkeys.\"\n- Multiple stop strings and a newline: [\"cat\", \"dog\", \" .\", \"####\", \"\\n\"]\n"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"},"mock_response":{"$ref":"#/components/schemas/MockResponseConfig"},"documents":{"items":{"$ref":"#/components/schemas/DocumentSchema"},"type":"array","title":"Documents","default":[]},"response_format":{"allOf":[{"$ref":"#/components/schemas/ResponseFormat"}],"title":"Response Format","default":{"type":"text"}}},"type":"object","required":["model","messages"],"title":"ChatRequest"},"ChatStreamingContentDelta":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ChatStreamingContentDelta"},"ChatStreamingFirstDelta":{"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"}},"type":"object","required":["role"],"title":"ChatStreamingFirstDelta"},"ChatStreamingToolCallsDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDelta"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsDelta"},"ChatStreamingToolCallsFirstDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDeltaStart"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsFirstDelta"},"CompareTextRequest":{"properties":{"original_text":{"type":"string","title":"Original Text"},"modified_text":{"type":"string","title":"Modified Text"}},"type":"object","required":["original_text","modified_text"],"title":"CompareTextRequest"},"ComparisonOperator":{"type":"object","title":"ComparisonOperator"},"ConnectorConnectionStatus":{"properties":{"latest_updated":{"type":"string","format":"date-time","title":"Latest Updated"},"files_indexed":{"type":"integer","title":"Files Indexed"},"creation_date":{"type":"string","format":"date-time","title":"Creation Date"},"status":{"$ref":"#/components/schemas/ParagonSyncStatus"},"last_synced_at":{"type":"string","title":"Last Synced At"}},"type":"object","required":["files_indexed","creation_date","status"],"title":"ConnectorConnectionStatus"},"ConnectorsDataSources":{"properties":{"data_sources":{"items":{"$ref":"#/components/schemas/DataSourceMetadata"},"type":"array","title":"Data Sources"}},"type":"object","required":["data_sources"],"title":"ConnectorsDataSources"},"ConnectorsStatus":{"properties":{"created_at":{"type":"string","title":"Created At"},"workflow_status":{"$ref":"#/components/schemas/ConnectorsWorkflowStatus"},"files_successfully_uploaded":{"type":"integer","title":"Files Successfully Uploaded"},"failed_uploaded_files":{"type":"integer","title":"Failed Uploaded Files"}},"type":"object","required":["created_at","workflow_status","files_successfully_uploaded","failed_uploaded_files"],"title":"ConnectorsStatus"},"ConnectorsSyncParams":{"properties":{"token":{"type":"string","title":"Token"},"data_source":{"type":"string","title":"Data Source"},"organization_id":{"type":"string","title":"Organization Id"},"pipeline":{"type":"string","title":"Pipeline"},"configuration":{"type":"object","title":"Configuration"},"configuration_name":{"type":"string","title":"Configuration Name"}},"type":"object","required":["token","data_source","organization_id","pipeline"],"title":"ConnectorsSyncParams"},"ConnectorsToken":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"ConnectorsToken"},"ConnectorsWorkflowStatus":{"enum":["IN_PROGRESS","PARTIALLY_COMPLETED","FAILED","SUCCEEDED"],"title":"ConnectorsWorkflowStatus","description":"An enumeration."},"CreateAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"avatar":{"type":"string","title":"Avatar"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["name"],"title":"CreateAssistantRequest"},"CreateMCPStorageRequest":{"properties":{"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_value":{"type":"string","title":"Auth Value"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["server_url","server_label"],"title":"CreateMCPStorageRequest"},"CreateMaestroRunsPayload":{"properties":{"input":{"anyOf":[{"items":{"$ref":"#/components/schemas/Message"},"type":"array"},{"type":"string"}],"title":"Input"},"output_type":{"type":"object","title":"Output Type"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"context":{"type":"object","title":"Context"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__Requirement"},"type":"array","title":"Requirements"},"budget":{"type":"string","enum":["low","medium","high"],"title":"Budget"},"verbose":{"type":"boolean","title":"Verbose","default":false},"include":{"items":{"type":"string"},"type":"array","title":"Include"},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"assistant_id":{"type":"string","title":"Assistant Id"},"variant":{"type":"string","enum":["main","ingestion"],"title":"Variant","default":"main"},"custom_retrieval_configs":{"items":{"type":"object"},"type":"array","title":"Custom Retrieval Configs"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"}},"type":"object","required":["input"],"title":"CreateMaestroRunsPayload"},"CreateOrganizationSchemaRequest":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_object":{"type":"object","title":"Schema Object"},"run_classification":{"type":"boolean","title":"Run Classification","default":false}},"type":"object","required":["schema_name","schema_object"],"title":"CreateOrganizationSchemaRequest"},"CreatePlanPayload":{"properties":{"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"}},"type":"object","required":["code"],"title":"CreatePlanPayload"},"CreateRoutePayload":{"properties":{"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["plan_id","name","description","examples"],"title":"CreateRoutePayload"},"CreateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","required":["secret_name","secret_value"],"title":"CreateSecretPayload"},"DataSourceMetadata":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"},"icon":{"type":"string","title":"Icon"},"connected":{"type":"boolean","title":"Connected"}},"type":"object","required":["name","type","description","icon","connected"],"title":"DataSourceMetadata"},"DeleteAssistantResponse":{"properties":{"object":{"type":"string","title":"Object","default":"assistant"},"deleted":{"type":"boolean","title":"Deleted","default":true},"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteAssistantResponse"},"DeleteMCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteMCPStorageResponse"},"Demo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["id","name","visibility","status","ui_component_name"],"title":"Demo"},"DemoCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["name","visibility","status","ui_component_name"],"title":"DemoCreate"},"DemoStatus":{"enum":["active","inactive"],"title":"DemoStatus","description":"An enumeration."},"DemoUpdate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","title":"DemoUpdate"},"DemoVisibility":{"enum":["public","private"],"title":"DemoVisibility","description":"An enumeration."},"DetectSchemaRequest":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentReference"},"type":"array","title":"Documents"},"queries":{"items":{"type":"string"},"type":"array","title":"Queries"}},"type":"object","required":["documents"],"title":"DetectSchemaRequest"},"DetectSchemaResponse":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"}},"type":"object","required":["schema_name","schema_definition"],"title":"DetectSchemaResponse"},"DocumentReference":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["document_id","name"],"title":"DocumentReference"},"DocumentSchema":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"content":{"type":"string","title":"Content"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata","default":{}}},"type":"object","required":["content"],"title":"DocumentSchema"},"DownloadModifiedDocumentRequest":{"properties":{"content":{"type":"string","title":"Content"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["content","filename"],"title":"DownloadModifiedDocumentRequest"},"FileResponse":{"properties":{"fileId":{"type":"string","format":"uuid","title":"Fileid","description":"The unique identifier of the file, generated by AI21.\n"},"name":{"type":"string","title":"Name","description":"The name of the file. This is the local file name from when the file was\nuploaded. It cannot be modified.\n"},"path":{"type":"string","title":"Path","description":"An arbitrary file-path-like string to indicate the content of a file. This has\nnothing to do with the location of the file in storage or on disk, and is only\nanother label that you can assign to the file in path-like format to help you\norganize the contents of the file or filter queries against your files. Example\npaths might be `pets/fish` or `pets/dogs`. Then, when searching your library,\nyou can filter files by the full path or path prefix. So to search only files\nin the \"dog folder\", filter by the path `/pets/dogs`. To search all files in\nthe \"pet folder\", filter your search by the path `pets/` when searching by path.\nThere isn't a restriction on whether a path must start or end with a / mark, but\nbe consistent in your usage, and all matches are prefix matching, not substring\nmatching. So filtering by `dog/` matches `dog/` and `dog/setter` but not `pets/dog/`.\n"},"fileType":{"type":"string","title":"Filetype","description":"The file type. See the file upload method to learn what file types are supported.\n"},"sizeBytes":{"type":"integer","title":"Sizebytes","description":"The size of the file, in bytes."},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any string labels you have associated with the file. You can apply arbitrary\nstring labels to your files and limit queries to files with one or more labels.\nSimilar to paths, but labels do not prefix match. Labels are case-sensitive.\nThere can be a maximum of 20 unique labels per account.\n"},"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"createdBy":{"type":"string","format":"uuid","title":"Createdby","description":"An internal identifier of the user who uploaded the file.\n"},"creationDate":{"type":"string","format":"date","title":"Creationdate","description":"The date when the file was uploaded."},"lastUpdated":{"type":"string","format":"date","title":"Lastupdated","description":"When the file data or metadata was last changed."},"status":{"type":"string","title":"Status","description":"File status. One of the following values: \"DB_RECORD_CREATED\",\n\"UPLOADED\", \"UPLOAD_FAILED\", \"PROCESSED\", \"PROCESSING_FAILED\"\n"},"dataSource":{"type":"string","title":"Datasource"}},"type":"object","required":["fileId","name","fileType","sizeBytes","createdBy","creationDate","lastUpdated","status"],"title":"FileResponse"},"FileSearchToolResource":{"properties":{"type":{"type":"string","enum":["file_search"],"title":"Type","default":"file_search"},"retrieval_similarity_threshold":{"type":"number","title":"Retrieval Similarity Threshold"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"labels_filter_mode":{"type":"string","enum":["AND","OR"],"title":"Labels Filter Mode","default":"AND"},"labels_filter":{"$ref":"#/components/schemas/QueryFilter"},"file_ids":{"items":{"type":"string"},"type":"array","title":"File Ids"},"retrieval_strategy":{"allOf":[{"$ref":"#/components/schemas/RetrievalStrategy"}],"default":"segments"},"max_neighbors":{"type":"integer","title":"Max Neighbors"},"path":{"type":"string","title":"Path"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"hybrid_search_alpha":{"type":"number","title":"Hybrid Search Alpha","default":1},"use_two_step_embedders":{"type":"boolean","title":"Use Two Step Embedders","default":false}},"type":"object","title":"FileSearchToolResource"},"FileStatus":{"type":"string","enum":["DB_RECORD_CREATED","UPLOADED","UPLOAD_FAILED","PROCESSED","PROCESSING_FAILED"],"title":"FileStatus","description":"An enumeration."},"FilesUpdateRequest":{"properties":{"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any labels to associate with this file. Separate multiple labels with commas. If\nprovided, will overwrite all existing labels.\n"}},"type":"object","title":"FilesUpdateRequest"},"FunctionToolDefinition":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/ToolParameters"}},"type":"object","required":["name"],"title":"FunctionToolDefinition"},"GenerateAssistantRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"avatar":{"type":"string","title":"Avatar"}},"type":"object","required":["prompt"],"title":"GenerateAssistantRequest"},"GenerateAssistantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"},"custom_tool_needed":{"additionalProperties":{"type":"string"},"type":"object","title":"Custom Tool Needed"},"recommended_files":{"items":{"type":"string"},"type":"array","title":"Recommended Files"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"GenerateAssistantResponse"},"HTTPToolEndpoint":{"properties":{"url":{"type":"string","title":"Url"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["url"],"title":"HTTPToolEndpoint"},"HTTPToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/HTTPToolFunctionParameters"}},"type":"object","required":["name","description","parameters"],"title":"HTTPToolFunction"},"HTTPToolFunctionParamProperties":{"properties":{"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"}},"type":"object","required":["type","description"],"title":"HTTPToolFunctionParamProperties"},"HTTPToolFunctionParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","default":"object"},"properties":{"additionalProperties":{"$ref":"#/components/schemas/HTTPToolFunctionParamProperties"},"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required"},"additionalProperties":{"type":"boolean","title":"Additionalproperties","default":false}},"type":"object","required":["properties","required"],"title":"HTTPToolFunctionParameters"},"HTTPToolResource":{"properties":{"type":{"type":"string","enum":["http"],"title":"Type","default":"http"},"function":{"$ref":"#/components/schemas/HTTPToolFunction"},"endpoint":{"$ref":"#/components/schemas/HTTPToolEndpoint"}},"type":"object","required":["function","endpoint"],"title":"HTTPToolResource"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IgnestionBatchStatusCount":{"properties":{"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["status","count"],"title":"IgnestionBatchStatusCount"},"IngestionBatchStatusResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id","description":"The UUID of the batch"},"total_documents":{"type":"integer","title":"Total Documents","description":"Total number of documents in the batch"},"statuses":{"items":{"$ref":"#/components/schemas/IgnestionBatchStatusCount"},"type":"array","title":"Statuses","description":"List of document counts by status"}},"type":"object","required":["batch_id","total_documents","statuses"],"title":"IngestionBatchStatusResponse"},"JambaExecuteRequest":{"properties":{"content":{"type":"string","title":"Content"},"task":{"type":"string","title":"Task"},"prompt":{"type":"string","title":"Prompt"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["content","task","prompt"],"title":"JambaExecuteRequest"},"LibrarySearchRequest":{"properties":{"query":{"type":"string","title":"Query"},"maxSegments":{"type":"integer","title":"Maxsegments"},"path":{"type":"string","title":"Path"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"labels_filter":{"$ref":"#/components/schemas/QueryFilter"},"labels_filter_mode":{"type":"string","enum":["AND","OR"],"title":"Labels Filter Mode","default":"AND"},"fileIds":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Fileids"},"retrievalStrategy":{"allOf":[{"$ref":"#/components/schemas/RetrievalStrategy"}],"default":"segments"},"maxNeighbors":{"type":"integer","title":"Maxneighbors","default":1},"retrievalSimilarityThreshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Retrievalsimilaritythreshold"},"hybridSearchAlpha":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Hybridsearchalpha"}},"type":"object","required":["query"],"title":"LibrarySearchRequest","description":"This class is to be used as a common class to all Studio API requests payloads"},"ListAssistantsResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListAssistantsResponse"},"ListMCPsStorageResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MCPStorageResponse"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListMCPsStorageResponse"},"ListPlansResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Plan"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListPlansResponse"},"ListRoutesResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantRoute"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListRoutesResponse"},"LogicalOperator":{"additionalProperties":{"items":{"type":"object"},"type":"array"},"type":"object","title":"LogicalOperator"},"Logprobs":{"properties":{"content":{"items":{"$ref":"#/components/schemas/LogprobsData"},"type":"array","title":"Content"}},"type":"object","required":["content"],"title":"Logprobs"},"LogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"},"top_logprobs":{"items":{"$ref":"#/components/schemas/TopLogprobsData"},"type":"array","title":"Top Logprobs"}},"type":"object","required":["token","logprob"],"title":"LogprobsData"},"MCPDefinition":{"properties":{"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["server_url"],"title":"MCPDefinition"},"MCPDiscoveryResponse":{"properties":{"mcp_definition":{"$ref":"#/components/schemas/MCPDefinition"},"tools":{"items":{"$ref":"#/components/schemas/MCPTool"},"type":"array","title":"Tools"}},"type":"object","required":["mcp_definition","tools"],"title":"MCPDiscoveryResponse"},"MCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_secret_key":{"type":"string","title":"Auth Secret Key"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["id","server_url","server_label","organization_id","user_id"],"title":"MCPStorageResponse"},"MCPTool":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"inputSchema":{"type":"object","title":"Inputschema"}},"type":"object","required":["name","inputSchema"],"title":"MCPTool"},"MCPToolResource":{"properties":{"type":{"type":"string","enum":["mcp"],"title":"Type","default":"mcp"},"server_label":{"type":"string","title":"Server Label"},"server_url":{"type":"string","title":"Server Url"},"headers":{"type":"object","title":"Headers"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"mcp_id":{"type":"string","title":"Mcp Id"}},"type":"object","title":"MCPToolResource"},"MaestroRunError":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MaestroRunError"},"MaestroRunResult":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"status":{"type":"string","enum":["completed","failed","in_progress","requires_action"],"title":"Status"},"result":{"title":"Result"},"data_sources":{"type":"object","title":"Data Sources"},"requirements_result":{"type":"object","title":"Requirements Result"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"error":{"$ref":"#/components/schemas/MaestroRunError"}},"type":"object","required":["id","status"],"title":"MaestroRunResult"},"MarkdownRequest":{"properties":{"text":{"type":"string","title":"Text","description":"All section answers concatenated"}},"type":"object","required":["text"],"title":"MarkdownRequest"},"Message":{"properties":{"role":{"type":"string","enum":["assistant","user"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"Message"},"MockResponseConfig":{"properties":{"response_delay_seconds":{"type":"number","minimum":0.0,"title":"Response Delay Seconds","default":1},"stream_response_delay_between_deltas_seconds":{"type":"number","minimum":0.0,"title":"Stream Response Delay Between Deltas Seconds","default":0.1}},"type":"object","title":"MockResponseConfig","include_in_schema":false},"ModelInfo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"},"updated":{"type":"string","title":"Updated"},"context_length":{"type":"integer","title":"Context Length"},"quantization":{"$ref":"#/components/schemas/ModelQuantization"},"max_completion_tokens":{"type":"integer","title":"Max Completion Tokens"},"pricing":{"$ref":"#/components/schemas/ModelPricing"}},"type":"object","required":["id","name","updated","context_length","quantization","max_completion_tokens","pricing"],"title":"ModelInfo"},"ModelName":{"type":"string","enum":["jamba-mini","jamba-large","jamba-large-1.7","jamba-large-1.7-2025-07","jamba-mini-2","jamba-mini-2-2026-01"],"title":"ModelName","description":"An enumeration."},"ModelPricing":{"properties":{"prompt":{"type":"string","title":"Prompt"},"completion":{"type":"string","title":"Completion"}},"type":"object","required":["prompt","completion"],"title":"ModelPricing"},"ModelQuantization":{"type":"string","enum":["FP8","experts_int8"],"title":"ModelQuantization","description":"An enumeration."},"ModelsInfoResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelsInfoResponse"},"ModifyAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"$ref":"#/components/schemas/RunOptimization"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"$ref":"#/components/schemas/BudgetLevel"},"visibility":{"$ref":"#/components/schemas/Visibility"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","title":"ModifyAssistantRequest"},"OrgSchema":{"properties":{"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"},"table_stats":{"type":"object","title":"Table Stats"}},"type":"object","required":["organization_id","schema_name","schema_definition","table_stats"],"title":"OrgSchema"},"OrgSchemas":{"properties":{"schemas":{"items":{"$ref":"#/components/schemas/OrgSchema"},"type":"array","title":"Schemas"}},"type":"object","required":["schemas"],"title":"OrgSchemas"},"ParagonSyncStatus":{"type":"string","enum":["ACTIVE","IDLE","ERRORED","PAUSED"],"title":"ParagonSyncStatus","description":"An enumeration."},"Plan":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","code","assistant_id"],"title":"Plan"},"QueryFilter":{"anyOf":[{"$ref":"#/components/schemas/ComparisonOperator"},{"$ref":"#/components/schemas/LogicalOperator"},{"additionalProperties":{"$ref":"#/components/schemas/ComparisonOperator"},"type":"object"}],"title":"QueryFilter"},"RFIResponseSection":{"properties":{"header":{"type":"string","title":"Header","description":"Exact or closest RFI heading for the section"},"description":{"type":"string","title":"Description","description":"≤350-character directive listing everything to include in that section"},"generated_content":{"type":"string","title":"Generated Content","description":"Generated content for this section based on company files"}},"type":"object","required":["header","description"],"title":"RFIResponseSection","description":"Model for a single RFI response section."},"RequirementItem":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"RequirementItem"},"RequirementsGenerationRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"RequirementsGenerationRequest"},"RequirementsGenerationResponse":{"properties":{"requirements":{"items":{"$ref":"#/components/schemas/RequirementItem"},"type":"array","title":"Requirements"}},"type":"object","required":["requirements"],"title":"RequirementsGenerationResponse"},"ResponseFormat":{"properties":{"type":{"type":"string","enum":["text","json_object"],"title":"Type"}},"type":"object","required":["type"],"title":"ResponseFormat"},"RetrievalStrategy":{"type":"string","enum":["segments","default","add_neighbors","full_doc"],"title":"RetrievalStrategy","description":"An enumeration."},"RunAssistantRequest":{"properties":{"input":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","title":"Input"},"verbose":{"type":"boolean","title":"Verbose","default":false},"output_type":{"type":"object","title":"Output Type"},"include":{"items":{"type":"string"},"type":"array","title":"Include","default":["data_sources","requirements_result","requirements_result.metadata"]},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"}},"type":"object","required":["input"],"title":"RunAssistantRequest"},"RunOptimization":{"enum":["cost","latency"],"title":"RunOptimization","description":"An enumeration."},"SecretResponse":{"properties":{"secret_id":{"type":"string","title":"Secret Id"},"secret_key":{"type":"string","title":"Secret Key"}},"type":"object","required":["secret_id","secret_key"],"title":"SecretResponse"},"StarterQuestion":{"properties":{"title":{"type":"string","title":"Title"},"prompt":{"type":"string","title":"Prompt"}},"type":"object","required":["title","prompt"],"title":"StarterQuestion"},"SystemMessage":{"properties":{"role":{"type":"string","enum":["system"],"title":"Role","default":"system","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"SystemMessage"},"ThreadNameGenerationRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"ThreadNameGenerationRequest"},"ThreadNameGenerationResponse":{"properties":{"thread_name":{"type":"string","title":"Thread Name"}},"type":"object","required":["thread_name"],"title":"ThreadNameGenerationResponse"},"ToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"type":{"type":"string","enum":["function"],"title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/ToolFunction"}},"type":"object","required":["id","function"],"title":"ToolCall"},"ToolCallDelta":{"properties":{"index":{"type":"integer","title":"Index"},"function":{"$ref":"#/components/schemas/ToolFunctionDelta"}},"type":"object","required":["index","function"],"title":"ToolCallDelta"},"ToolCallDeltaStart":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"index":{"type":"integer","title":"Index"},"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/ToolFunctionDeltaStart"}},"type":"object","required":["id","index","type","function"],"title":"ToolCallDeltaStart"},"ToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["name","arguments"],"title":"ToolFunction"},"ToolFunctionDelta":{"properties":{"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["arguments"],"title":"ToolFunctionDelta"},"ToolFunctionDeltaStart":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ToolFunctionDeltaStart"},"ToolMessage":{"properties":{"role":{"type":"string","enum":["tool"],"title":"Role","default":"tool","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_call_id":{"type":"string","title":"Tool Call Id"}},"type":"object","required":["content","tool_call_id"],"title":"ToolMessage"},"ToolParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","description":"Type of the parameter schema, only `object` is supported","default":"object"},"properties":{"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required","description":"List of required properties"}},"type":"object","required":["properties"],"title":"ToolParameters"},"TopLogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"}},"type":"object","required":["token","logprob"],"title":"TopLogprobsData"},"UpdateMCPStorageRequest":{"properties":{"server_label":{"type":"string","title":"Server Label"}},"type":"object","required":["server_label"],"title":"UpdateMCPStorageRequest"},"UpdateRoutePayload":{"properties":{"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["description"],"title":"UpdateRoutePayload"},"UpdateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","title":"UpdateSecretPayload"},"UploadMode":{"type":"string","enum":["immediate","batch"],"title":"UploadMode","description":"An enumeration."},"UsageInfo":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt for this request. Note that the prompt token\nincludes the entire message history, plus extra tokens needed by the system\nwhen combining the list of prompt messages into a single message, as\nrequired by the model. The number of extra tokens is typically proportional\nto the number of messages in the thread, and should be relatively small.\n"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the response message."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"`prompt_tokens` + `completion_tokens`.\n"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"UsageInfo"},"UserMessage":{"properties":{"role":{"type":"string","enum":["user"],"title":"Role","default":"user","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"UserMessage"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationResult":{"properties":{"is_valid":{"type":"boolean","title":"Is Valid"},"message":{"type":"string","title":"Message"},"details":{"type":"string","title":"Details"}},"type":"object","required":["is_valid"],"title":"ValidationResult"},"Visibility":{"enum":["public","private"],"title":"Visibility","description":"An enumeration."},"WebSearchToolResource":{"properties":{"type":{"type":"string","enum":["web_search"],"title":"Type","default":"web_search"},"urls":{"items":{"type":"string"},"type":"array","title":"Urls"},"fallback_to_web":{"type":"boolean","title":"Fallback To Web"},"query_suffix":{"type":"string","title":"Query Suffix"},"rephrase_query":{"type":"boolean","title":"Rephrase Query"},"use_cached_pages":{"type":"boolean","title":"Use Cached Pages","default":false}},"type":"object","title":"WebSearchToolResource"},"WebsiteConnectorCreateConfigPayload":{"properties":{"name":{"type":"string","title":"Name"},"extract_linked_files":{"type":"boolean","title":"Extract Linked Files","default":false},"wait_for_dynamic_content":{"type":"boolean","title":"Wait For Dynamic Content","default":false},"skip_url_patterns":{"items":{"type":"string"},"type":"array","title":"Skip Url Patterns"},"target_file_extensions":{"items":{"type":"string"},"type":"array","title":"Target File Extensions"},"localization":{"type":"string","title":"Localization"}},"type":"object","required":["name","skip_url_patterns","target_file_extensions"],"title":"WebsiteConnectorCreateConfigPayload"},"WebsiteConnectorIngestUrlPayload":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"WebsiteConnectorIngestUrlPayload"},"WebsiteConnectorIngestWebsitePayload":{"properties":{"sitemap_url":{"type":"string","title":"Sitemap Url"},"client_config":{"type":"string","title":"Client Config"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"}},"type":"object","required":["sitemap_url"],"title":"WebsiteConnectorIngestWebsitePayload"},"WebsiteConnectorPayload":{"properties":{"type":{"type":"string","enum":["sitemap","urls"],"title":"Type"},"value":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Value"}},"type":"object","required":["type","value"],"title":"WebsiteConnectorPayload"},"WebsiteConnectorRetryIngestWebsitePayload":{"properties":{"website_id":{"type":"string","format":"uuid","title":"Website Id"}},"type":"object","required":["website_id"],"title":"WebsiteConnectorRetryIngestWebsitePayload"},"WorkflowConfig":{"properties":{"endpoint_url":{"type":"string","title":"Endpoint Url"},"headers":{"type":"object","title":"Headers"},"additional_params":{"type":"object","title":"Additional Params"}},"type":"object","required":["endpoint_url"],"title":"WorkflowConfig"},"WorkspaceModelResponse":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"provider":{"type":"string","title":"Provider"},"internal":{"type":"boolean","title":"Internal","default":false}},"type":"object","required":["name","model_type"],"title":"WorkspaceModelResponse"},"WorkspaceModelUpdate":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"}},"type":"object","title":"WorkspaceModelUpdate"},"WorkspaceModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/WorkspaceModelResponse"},"type":"array","title":"Models"}},"type":"object","required":["models"],"title":"WorkspaceModelsResponse"},"language_studio_api_server__data_types__assistant__Requirement":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"type":{"type":"string","title":"Type"}},"type":"object","title":"Requirement"},"language_studio_api_server__data_types__chat__ToolDefinition":{"properties":{"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/FunctionToolDefinition"}},"type":"object","required":["type","function"],"title":"ToolDefinition"},"language_studio_api_server__data_types__execution_engine__Requirement":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"is_mandatory":{"type":"boolean","title":"Is Mandatory"}},"type":"object","required":["name","description"],"title":"Requirement"},"language_studio_api_server__data_types__execution_engine__ToolDefinition":{"oneOf":[{"$ref":"#/components/schemas/HTTPToolResource"},{"$ref":"#/components/schemas/MCPToolResource"},{"$ref":"#/components/schemas/FileSearchToolResource"},{"$ref":"#/components/schemas/WebSearchToolResource"}],"title":"ToolDefinition","discriminator":{"propertyName":"type","mapping":{"http":"#/components/schemas/HTTPToolResource","mcp":"#/components/schemas/MCPToolResource","file_search":"#/components/schemas/FileSearchToolResource","web_search":"#/components/schemas/WebSearchToolResource"}}}}}} \ No newline at end of file