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..444b3549 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,12 @@ 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) { PrepareArguments( @@ -62,25 +65,46 @@ 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 +114,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..88eb2b6c 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +69,43 @@ 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 +115,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +427,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 +444,7 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo return await CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 25e41545..2735814e 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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: true); + + 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,169 +114,331 @@ 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; + 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; + } + } + __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); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - 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); - ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( - 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: "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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 new global::AI21.ApiException( + message: __content ?? __response.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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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(); + } } /// /// 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 @@ -262,6 +448,7 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte return await ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs index 82d02f97..7a78c304 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +69,43 @@ 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 +115,315 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +444,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 +453,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 +467,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..38a1c54a 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,315 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +436,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 +447,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 +463,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..10cd9cd8 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +73,43 @@ 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 +119,312 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +435,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 +443,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 +456,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..22b0d4e9 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,12 @@ 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) { PrepareArguments( @@ -63,22 +66,43 @@ 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 +112,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..d63c6717 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.DeleteMCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..eb187a79 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,13 @@ 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) { PrepareArguments( @@ -67,22 +70,43 @@ 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 +116,306 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..7172c715 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..b6df9eb2 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..4c9bf1d2 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,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::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 +73,43 @@ 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 +119,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.DetectSchemaResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +436,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 +455,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..a51c0a02 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +69,43 @@ 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 +115,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +427,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 +444,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..8a5e81d1 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,11 @@ 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) { PrepareArguments( @@ -57,22 +60,43 @@ 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 +106,266 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..8b9960bc 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..e4a34e53 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +426,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 +441,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..139ff736 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.AssistantsByMcpResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..b19b2e2d 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,11 @@ 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) { PrepareArguments( @@ -57,22 +60,43 @@ 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 +106,266 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..3b2f6899 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,14 @@ 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) { PrepareArguments( @@ -72,25 +75,46 @@ 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 +124,311 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ConnectorConnectionStatus.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..63defa96 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,14 @@ 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) { PrepareArguments( @@ -72,25 +75,46 @@ 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 +124,311 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..0c939229 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,12 @@ 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) { PrepareArguments( @@ -63,22 +66,43 @@ 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 +112,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..3d49e483 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,13 @@ 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) { PrepareArguments( @@ -67,25 +70,46 @@ 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 +119,306 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..c37b0f66 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..91acb07e 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ConnectorsDataSources.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..fbbbb052 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.OrgSchemas.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..185f794a 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,13 @@ 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) { PrepareArguments( @@ -71,25 +74,46 @@ 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 +123,306 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..9f30a43e 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,12 @@ 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) { PrepareArguments( @@ -63,25 +66,46 @@ 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 +115,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..d1824099 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,13 @@ 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) { PrepareArguments( @@ -71,25 +74,46 @@ 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 +123,306 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..c0eb31d2 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,12 @@ 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) { PrepareArguments( @@ -63,22 +66,43 @@ 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 +112,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..36f04aea 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..c84d543b 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,11 @@ 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) { PrepareArguments( @@ -57,22 +60,43 @@ 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 +106,266 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..8d85b863 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.SecretResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..b36a264c 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,11 @@ 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) { PrepareArguments( @@ -57,22 +60,43 @@ 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 +106,270 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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(); + + return + global::AI21.WorkspaceModelsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::AI21.WorkspaceModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..6b34df48 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +69,43 @@ 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 +115,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +429,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 +437,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 +450,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..1ee1f336 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs new file mode 100644 index 00000000..f86dd58c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs new file mode 100644 index 00000000..bc8321d3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs new file mode 100644 index 00000000..0924db7e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.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..fab1c912 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,11 @@ 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) { PrepareArguments( @@ -58,22 +61,43 @@ 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 +107,270 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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(); + + 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 new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + (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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..504f4a24 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,12 @@ 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) { PrepareArguments( @@ -62,25 +65,46 @@ 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 +114,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ListMCPsStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..7221169b 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,315 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.MCPDiscoveryResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +430,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 +449,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..ca4ec13d 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +69,43 @@ 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: true); + + 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,157 +115,344 @@ 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; + 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; + } + __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); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - 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); - ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( - 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: "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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 new global::AI21.ApiException( + message: __content ?? __response.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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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(); + } } /// /// Parse Pdf
@@ -249,11 +460,13 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon ///
/// /// + /// Per-request overrides 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 @@ -264,6 +477,7 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon return await ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs index 7fce17e0..d3cfc2c8 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,324 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +442,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..329d16b7 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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: true); + + 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,175 +114,362 @@ 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) - { + 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; + } + if (request.Budget != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Budget}"), - name: "\"budget\""); - } - if (request.VectorStoreId != 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}"), - name: "\"vector_store_id\""); - } - __httpRequest.Content = __httpRequestContent; + __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); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - 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); - ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( - 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: "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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + (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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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(); + } } /// /// Process Rfi Document @@ -276,6 +487,7 @@ 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( @@ -283,6 +495,7 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont 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 @@ -295,6 +508,7 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont return await ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs index adc0c1aa..50570019 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +429,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 +439,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 +454,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..4d79870c 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,14 @@ 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) { PrepareArguments( @@ -72,22 +75,43 @@ 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 +121,307 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..25565b48 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..6595c91d 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -71,22 +74,43 @@ 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 +120,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +451,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 +461,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 +476,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..c250bb6d 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +73,43 @@ 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 +119,329 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +452,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..7d077c8c 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +73,43 @@ 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 +119,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.WorkspaceModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +437,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 +445,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 +458,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..abe34553 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +69,43 @@ 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: true); + + 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,171 +115,358 @@ 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) - { + 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; + } + if (request.Budget != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Budget}"), - name: "\"budget\""); - } - if (request.VectorStoreId != 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}"), - name: "\"vector_store_id\""); - } - __httpRequest.Content = __httpRequestContent; + __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); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - 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); - ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( - 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: "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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 new global::AI21.ApiException( + message: __content ?? __response.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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Upload Check Compliance
@@ -269,6 +480,7 @@ 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( @@ -276,6 +488,7 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp 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 @@ -288,6 +501,7 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp return await UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs index 414c44b1..c2dbfd18 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,315 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +444,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 +461,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 +483,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..5ee0eacc 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,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, 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 +73,43 @@ 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 +119,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +436,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 +455,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..1669bb6e 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +73,43 @@ 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 +119,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +438,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 +447,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 +461,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.V1DeepResearchRun.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeepResearchRun.g.cs new file mode 100644 index 00000000..90a87177 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeepResearchRun.g.cs @@ -0,0 +1,463 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1DeepResearchRunSecurityRequirement0 = + 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_V1DeepResearchRunSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1DeepResearchRunSecurityRequirement0, + }; + partial void PrepareV1DeepResearchRunArguments( + global::System.Net.Http.HttpClient httpClient, + global::AI21.CreateDeepResearchPayload request); + partial void PrepareV1DeepResearchRunRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::AI21.CreateDeepResearchPayload request); + partial void ProcessV1DeepResearchRunResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1DeepResearchRunResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Deep Research 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 V1DeepResearchRunAsync( + + global::AI21.CreateDeepResearchPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareV1DeepResearchRunArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1DeepResearchRunSecurityRequirements, + operationName: "V1DeepResearchRunAsync"); + + 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/deep-research/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; +#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 __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); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1DeepResearchRunRequest( + 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: "V1DeepResearchRun", + methodName: "V1DeepResearchRunAsync", + pathTemplate: "\"/studio/v1/deep-research/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeepResearchRun", + methodName: "V1DeepResearchRunAsync", + pathTemplate: "\"/studio/v1/deep-research/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeepResearchRun", + methodName: "V1DeepResearchRunAsync", + pathTemplate: "\"/studio/v1/deep-research/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1DeepResearchRunResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeepResearchRun", + methodName: "V1DeepResearchRunAsync", + pathTemplate: "\"/studio/v1/deep-research/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeepResearchRun", + methodName: "V1DeepResearchRunAsync", + pathTemplate: "\"/studio/v1/deep-research/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + 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 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 (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1DeepResearchRunResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::AI21.DeepResearchRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::AI21.DeepResearchRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::AI21.ApiException( + message: __content ?? __response.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 Deep Research Run + /// + /// + /// + /// + /// Whether or not to stream the result one token at a time using
+ /// [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
+ /// This can be useful when waiting for long results where a long wait time for an
+ /// answer can be problematic, such as a chatbot. If set to `True`, then `n` must
+ /// 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 V1DeepResearchRunAsync( + string prompt, + double budgetCost, + bool? stream = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.CreateDeepResearchPayload + { + Prompt = prompt, + BudgetCost = budgetCost, + Stream = stream, + }; + + return await V1DeepResearchRunAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs index 7da4a25c..8843341a 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.DeleteAssistantResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..37ea21df 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,13 @@ 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) { PrepareArguments( @@ -67,22 +70,43 @@ 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 +116,306 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..d20c6ebd 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,328 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.GenerateAssistantResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +446,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..75585e61 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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.V1GetDeepResearchEntitlement.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetDeepResearchEntitlement.g.cs new file mode 100644 index 00000000..b30e753c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetDeepResearchEntitlement.g.cs @@ -0,0 +1,375 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1GetDeepResearchEntitlementSecurityRequirement0 = + 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_V1GetDeepResearchEntitlementSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1GetDeepResearchEntitlementSecurityRequirement0, + }; + partial void PrepareV1GetDeepResearchEntitlementArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1GetDeepResearchEntitlementRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1GetDeepResearchEntitlementResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1GetDeepResearchEntitlementResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Deep Research Entitlement + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1GetDeepResearchEntitlementAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1GetDeepResearchEntitlementArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1GetDeepResearchEntitlementSecurityRequirements, + operationName: "V1GetDeepResearchEntitlementAsync"); + + 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/deep-research/entitlement", + 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); + PrepareV1GetDeepResearchEntitlementRequest( + 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: "V1GetDeepResearchEntitlement", + methodName: "V1GetDeepResearchEntitlementAsync", + pathTemplate: "\"/studio/v1/deep-research/entitlement\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchEntitlement", + methodName: "V1GetDeepResearchEntitlementAsync", + pathTemplate: "\"/studio/v1/deep-research/entitlement\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchEntitlement", + methodName: "V1GetDeepResearchEntitlementAsync", + pathTemplate: "\"/studio/v1/deep-research/entitlement\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1GetDeepResearchEntitlementResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchEntitlement", + methodName: "V1GetDeepResearchEntitlementAsync", + pathTemplate: "\"/studio/v1/deep-research/entitlement\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchEntitlement", + methodName: "V1GetDeepResearchEntitlementAsync", + pathTemplate: "\"/studio/v1/deep-research/entitlement\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + 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); + ProcessV1GetDeepResearchEntitlementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::AI21.DeepResearchEntitlement.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::AI21.DeepResearchEntitlement.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::AI21.ApiException( + message: __content ?? __response.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.V1GetDeepResearchRun.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetDeepResearchRun.g.cs new file mode 100644 index 00000000..610e0760 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetDeepResearchRun.g.cs @@ -0,0 +1,451 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1GetDeepResearchRunSecurityRequirement0 = + 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_V1GetDeepResearchRunSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1GetDeepResearchRunSecurityRequirement0, + }; + partial void PrepareV1GetDeepResearchRunArguments( + global::System.Net.Http.HttpClient httpClient, + ref string executionId, + ref bool? stream, + ref string? lastEventId); + partial void PrepareV1GetDeepResearchRunRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string executionId, + bool? stream, + string? lastEventId); + partial void ProcessV1GetDeepResearchRunResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1GetDeepResearchRunResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Deep Research Run
+ /// Return the current run state, or SSE-stream if ``stream=true``.
+ /// Streaming lets clients reconnect to an in-progress run after a network
+ /// drop without creating a duplicate execution. The stream replays the
+ /// execution tracer from the current cursor and terminates with a ``result``
+ /// event once the run settles (or the run is already terminal).
+ /// Clients that want to resume from a specific position in the event stream
+ /// should send the standard SSE ``Last-Event-ID`` header; the tracer will
+ /// replay only events after that id (see systems-execution-tracer
+ /// ``events-stream`` endpoint). + ///
+ /// + /// + /// 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 V1GetDeepResearchRunAsync( + string executionId, + bool? stream = default, + string? lastEventId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1GetDeepResearchRunArguments( + httpClient: HttpClient, + executionId: ref executionId, + stream: ref stream, + lastEventId: ref lastEventId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1GetDeepResearchRunSecurityRequirements, + operationName: "V1GetDeepResearchRunAsync"); + + 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/deep-research/runs/{executionId}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("stream", stream?.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; +#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); + } + } + + if (lastEventId != default) + { + __httpRequest.Headers.TryAddWithoutValidation("Last-Event-ID", lastEventId.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetDeepResearchRunRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + executionId: executionId!, + stream: stream, + lastEventId: lastEventId); + + 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: "V1GetDeepResearchRun", + methodName: "V1GetDeepResearchRunAsync", + pathTemplate: "$\"/studio/v1/deep-research/runs/{executionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchRun", + methodName: "V1GetDeepResearchRunAsync", + pathTemplate: "$\"/studio/v1/deep-research/runs/{executionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchRun", + methodName: "V1GetDeepResearchRunAsync", + pathTemplate: "$\"/studio/v1/deep-research/runs/{executionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1GetDeepResearchRunResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchRun", + methodName: "V1GetDeepResearchRunAsync", + pathTemplate: "$\"/studio/v1/deep-research/runs/{executionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchRun", + methodName: "V1GetDeepResearchRunAsync", + pathTemplate: "$\"/studio/v1/deep-research/runs/{executionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + 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 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 (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetDeepResearchRunResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::AI21.DeepResearchRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::AI21.DeepResearchRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::AI21.ApiException( + message: __content ?? __response.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.V1GetDeepResearchStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetDeepResearchStatus.g.cs new file mode 100644 index 00000000..2781e76b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetDeepResearchStatus.g.cs @@ -0,0 +1,375 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1GetDeepResearchStatusSecurityRequirement0 = + 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_V1GetDeepResearchStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1GetDeepResearchStatusSecurityRequirement0, + }; + partial void PrepareV1GetDeepResearchStatusArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1GetDeepResearchStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1GetDeepResearchStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1GetDeepResearchStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Deep Research 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 V1GetDeepResearchStatusAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1GetDeepResearchStatusArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1GetDeepResearchStatusSecurityRequirements, + operationName: "V1GetDeepResearchStatusAsync"); + + 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/deep-research/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); + PrepareV1GetDeepResearchStatusRequest( + 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: "V1GetDeepResearchStatus", + methodName: "V1GetDeepResearchStatusAsync", + pathTemplate: "\"/studio/v1/deep-research/status\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + 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 __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchStatus", + methodName: "V1GetDeepResearchStatusAsync", + pathTemplate: "\"/studio/v1/deep-research/status\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchStatus", + methodName: "V1GetDeepResearchStatusAsync", + pathTemplate: "\"/studio/v1/deep-research/status\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1GetDeepResearchStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchStatus", + methodName: "V1GetDeepResearchStatusAsync", + pathTemplate: "\"/studio/v1/deep-research/status\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetDeepResearchStatus", + methodName: "V1GetDeepResearchStatusAsync", + pathTemplate: "\"/studio/v1/deep-research/status\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + 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); + ProcessV1GetDeepResearchStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::AI21.DeepResearchEnabled.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::AI21.DeepResearchEnabled.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::AI21.ApiException( + message: __content ?? __response.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..4324b62c 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..fa90beed 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,13 @@ 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) { PrepareArguments( @@ -67,22 +70,43 @@ 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 +116,310 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..3082f5af 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,13 @@ 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) { PrepareArguments( @@ -67,22 +70,43 @@ 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 +116,310 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..ba9e8bf8 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,12 @@ 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) { PrepareArguments( @@ -62,25 +65,46 @@ 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 +114,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ListAssistantsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..68a90476 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,11 @@ 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) { PrepareArguments( @@ -57,22 +60,43 @@ 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 +106,270 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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(); + + return + global::AI21.ModelsInfoResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::AI21.ModelsInfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..7fe641a4 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ListPlansResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..32e88460 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,13 @@ 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) { PrepareArguments( @@ -67,25 +70,46 @@ 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 +119,310 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ListRoutesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..b309aada 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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: true); + + 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 +114,315 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +461,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 +482,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 +508,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..9258162f 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +73,43 @@ 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 +119,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +456,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 +475,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 +499,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..50d4a34e 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,7 @@ partial void ProcessV1ModifyPlanResponseContent( 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 +78,43 @@ 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 +124,317 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +443,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 +451,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 +464,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..0576f443 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,7 @@ partial void ProcessV1ModifyRouteResponseContent( 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 +78,43 @@ 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 +124,317 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +443,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 +451,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 +464,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..f59e0642 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +73,43 @@ 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 +119,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +452,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 +465,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 +483,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..ec3c262b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotyProductLookup.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsClarotySuggestVendorModel.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotySuggestVendorModel.g.cs new file mode 100644 index 00000000..2bde531a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsClarotySuggestVendorModel.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs new file mode 100644 index 00000000..26b99807 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..8dd75a5d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..cad48a2a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..9476d0b1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..90bb376b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..b2a775b2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdPreviewBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs new file mode 100644 index 00000000..aad9f98a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..2b057257 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..06c5346a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..a17696f4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..b90e7b2a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..d3a1e0cd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacAftersalesBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs new file mode 100644 index 00000000..a98f7b49 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs new file mode 100644 index 00000000..5502134f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs new file mode 100644 index 00000000..c47baddb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs new file mode 100644 index 00000000..e09b673e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacPreviewV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs new file mode 100644 index 00000000..5b4afe48 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..a6af7c6d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..37df1809 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacPreviewV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs new file mode 100644 index 00000000..21609dd8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs new file mode 100644 index 00000000..1ed3ad67 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..325a5e33 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..e7a39b85 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsFnacV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs new file mode 100644 index 00000000..be1c9dff --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshDocumentUploadProcess.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshDocumentUploadProcess.g.cs new file mode 100644 index 00000000..ceeb5885 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshDocumentUploadProcess.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshEmailAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshEmailAssistant.g.cs new file mode 100644 index 00000000..855b1d57 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshEmailAssistant.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshFundingAndCategorizationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs new file mode 100644 index 00000000..bf453f1c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshGrantCompliance.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantCompliance.g.cs new file mode 100644 index 00000000..52fbba74 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantCompliance.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshGrantMetadata.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantMetadata.g.cs new file mode 100644 index 00000000..ba2625f3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshGrantMetadata.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs new file mode 100644 index 00000000..1ebe1686 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshPreviewEmailAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs new file mode 100644 index 00000000..1bbee2d1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs new file mode 100644 index 00000000..932faa88 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshPreviewGrantCompliance.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs new file mode 100644 index 00000000..b426bbe8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshPreviewGrantMetadata.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs new file mode 100644 index 00000000..2293a859 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshPreviewPublicInformationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs new file mode 100644 index 00000000..8457342b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsKirshPublicInformationCheck.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPublicInformationCheck.g.cs new file mode 100644 index 00000000..ac96ee5f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsKirshPublicInformationCheck.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsTlvMunicipalityConvrag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs new file mode 100644 index 00000000..ee8013e3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs new file mode 100644 index 00000000..eb7c71ac --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaActionItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaActionItems.g.cs new file mode 100644 index 00000000..6bd13873 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaActionItems.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaApiMessages.g.cs new file mode 100644 index 00000000..3e79addb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaApiMessages.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentApiMessages.g.cs new file mode 100644 index 00000000..b76938dd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentApiMessages.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentBrief.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBrief.g.cs new file mode 100644 index 00000000..e760b90d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBrief.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentBriefJobs.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobs.g.cs new file mode 100644 index 00000000..73519c35 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobs.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentBriefJobsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs new file mode 100644 index 00000000..4cef58ef --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentBriefScheduled.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefScheduled.g.cs new file mode 100644 index 00000000..91c5de27 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentBriefScheduled.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscribe.g.cs new file mode 100644 index 00000000..1445852e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscriptions.g.cs new file mode 100644 index 00000000..52fa9b11 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentSubscriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaContentUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentUnsubscribe.g.cs new file mode 100644 index 00000000..2d2d87d0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaContentUnsubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaFeedItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaFeedItems.g.cs new file mode 100644 index 00000000..3a63235b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaFeedItems.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewActionItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewActionItems.g.cs new file mode 100644 index 00000000..f6065174 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewActionItems.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewApiMessages.g.cs new file mode 100644 index 00000000..5962df09 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewApiMessages.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentApiMessages.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs new file mode 100644 index 00000000..0c10e8ab --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentBrief.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBrief.g.cs new file mode 100644 index 00000000..6e43b585 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBrief.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentBriefJobs.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs new file mode 100644 index 00000000..eb2af288 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs new file mode 100644 index 00000000..4802fc01 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs @@ -0,0 +1,415 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs new file mode 100644 index 00000000..dcc13485 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs new file mode 100644 index 00000000..f490f88d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs new file mode 100644 index 00000000..0ae76239 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs new file mode 100644 index 00000000..d72dde26 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewFeedItems.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewFeedItems.g.cs new file mode 100644 index 00000000..40ce00bb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewFeedItems.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewSchedulerStats.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs new file mode 100644 index 00000000..26ae3f99 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewSources.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSources.g.cs new file mode 100644 index 00000000..e1cb6dd1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSources.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscribe.g.cs new file mode 100644 index 00000000..5a08afeb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs new file mode 100644 index 00000000..92ae55a7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewSummarize.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSummarize.g.cs new file mode 100644 index 00000000..83abf33b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewSummarize.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewTriggerPoll.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs new file mode 100644 index 00000000..015d3c0b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaPreviewUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs new file mode 100644 index 00000000..9db82d90 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaSchedulerStats.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSchedulerStats.g.cs new file mode 100644 index 00000000..266fe1b4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSchedulerStats.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaSources.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSources.g.cs new file mode 100644 index 00000000..bba27465 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSources.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaSubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscribe.g.cs new file mode 100644 index 00000000..4d56ff01 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaSubscriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscriptions.g.cs new file mode 100644 index 00000000..fec42fb5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSubscriptions.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaSummarize.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSummarize.g.cs new file mode 100644 index 00000000..6e079ba0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaSummarize.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaTriggerPoll.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaTriggerPoll.g.cs new file mode 100644 index 00000000..be5c9b74 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaTriggerPoll.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1SolutionsVidaaUnsubscribe.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaUnsubscribe.g.cs new file mode 100644 index 00000000..9f9133b0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsVidaaUnsubscribe.g.cs @@ -0,0 +1,371 @@ + +#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) + { + 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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.V1StudioApiGenerationRequirements.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs index 97aeeef9..008fdff4 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,326 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.RequirementsGenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +443,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..921aab0a 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,326 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ThreadNameGenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +443,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..06766ad1 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,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, 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 +73,43 @@ 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 +119,316 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.ValidationResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +436,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 +455,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..834b1e0d 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, 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, 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, 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, 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, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -95,11 +98,37 @@ 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. + /// 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 = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + global::AI21.AutoSDKClientOptions? options = null, 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.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs index 50652c2b..46673ef1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..b791e7b4 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs @@ -9,11 +9,13 @@ 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
@@ -21,11 +23,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..b2a1d0bb 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -8,20 +8,24 @@ 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::System.Collections.Generic.IList files, + 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..9696c0c5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs @@ -9,11 +9,13 @@ 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
@@ -34,6 +36,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 +45,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..8a2b5725 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs @@ -8,11 +8,13 @@ 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 @@ -26,6 +28,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 +39,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..2bec9820 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs @@ -9,12 +9,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 CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( string organizationId, global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Organization Schema @@ -25,6 +27,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 +35,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..a4b93754 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs @@ -9,10 +9,12 @@ 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); } } \ 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..34872b73 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..612627e6 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs @@ -9,11 +9,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 DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync( 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..6022b39d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..71d39827 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..694bc968 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs @@ -9,12 +9,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::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Detect Schema @@ -22,12 +24,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..c7bab44a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs @@ -9,11 +9,13 @@ 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
@@ -21,11 +23,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.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs index e0869120..2faf95d8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs @@ -7,9 +7,11 @@ 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); } } \ 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..72a7497c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..7c7d023e 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs @@ -8,11 +8,13 @@ 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 @@ -20,10 +22,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..c74eb377 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..80dc5ecb 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs @@ -7,9 +7,11 @@ 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); } } \ 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..000ef062 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs @@ -10,12 +10,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 GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync( 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..3615a258 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs @@ -10,12 +10,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 GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync( 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..1f93d779 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs @@ -9,10 +9,12 @@ 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); } } \ 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..52bd21ef 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs @@ -9,11 +9,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 GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync( 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..3e69d7d7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..cbca2048 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..36e7946f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..23577786 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs @@ -13,11 +13,13 @@ 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); } } \ 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..ca0f36e2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs @@ -9,10 +9,12 @@ 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); } } \ 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..aae5eef0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs @@ -13,11 +13,13 @@ 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); } } \ 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..ed7e31f1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs @@ -9,10 +9,12 @@ 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); } } \ 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..9fd3031d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..3a90c0b4 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs @@ -7,9 +7,11 @@ 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); } } \ 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..a57d9b2c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..48df935d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs @@ -7,9 +7,11 @@ 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); } } \ 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..6b96d29f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs @@ -9,11 +9,13 @@ 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
@@ -23,6 +25,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 +33,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.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs new file mode 100644 index 00000000..a335fcf1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,19 @@ +#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); + } +} \ 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..d0a307ec --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGet.g.cs @@ -0,0 +1,19 @@ +#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); + } +} \ 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..2aa11736 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsPrefixPreviewSolutionsPreviewKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..b0c696eb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPost.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..dba957c2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs @@ -8,9 +8,11 @@ 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); } } \ 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..bc13235f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..c98e5445 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs @@ -8,11 +8,13 @@ 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 @@ -20,12 +22,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..510b04d0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs @@ -9,11 +9,13 @@ 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
@@ -21,11 +23,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 ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( byte[] 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..94640848 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs @@ -8,22 +8,26 @@ 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 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..ce0e0c1a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs @@ -8,11 +8,13 @@ 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 @@ -30,6 +32,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 +40,7 @@ public partial interface IAi21Client 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..919c3942 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs @@ -8,11 +8,13 @@ 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 @@ -23,6 +25,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 +35,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..626029ae 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs @@ -10,12 +10,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 RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync( 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..722b2b66 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..fdc34694 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs @@ -10,12 +10,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 UpdateDemoStudioV1DemosDemoIdPutAsync( string demoId, global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Demo
@@ -37,6 +39,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 +49,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..e45ac27e 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs @@ -9,23 +9,27 @@ 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 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..7dc3fbfc 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs @@ -9,12 +9,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 UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( string name, global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Workspace Model Endpoint @@ -23,6 +25,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 +33,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..ff240c91 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs @@ -9,11 +9,13 @@ 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
@@ -27,6 +29,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 +37,7 @@ public partial interface IAi21Client 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..66bbbcbe 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs @@ -8,11 +8,13 @@ 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 @@ -34,6 +36,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 +53,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..988d2101 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs @@ -9,12 +9,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, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Plan @@ -22,12 +24,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..9d10356c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs @@ -9,12 +9,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 V1CreateRouteAsync( string assistantId, global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Route @@ -24,6 +26,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 +35,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.V1DeepResearchRun.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeepResearchRun.g.cs new file mode 100644 index 00000000..60a6ebbf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeepResearchRun.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Create Deep Research 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 V1DeepResearchRunAsync( + + global::AI21.CreateDeepResearchPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Deep Research Run + /// + /// + /// + /// + /// Whether or not to stream the result one token at a time using
+ /// [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
+ /// This can be useful when waiting for long results where a long wait time for an
+ /// answer can be problematic, such as a chatbot. If set to `True`, then `n` must
+ /// 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 V1DeepResearchRunAsync( + string prompt, + double budgetCost, + 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.V1DeleteAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs index 5d789ab5..61394513 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..4f88fec1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs @@ -9,11 +9,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 V1DeleteRouteAsync( 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..398b72ee 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs @@ -8,22 +8,26 @@ 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 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..f0b8c142 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs @@ -8,10 +8,12 @@ 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); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetDeepResearchEntitlement.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetDeepResearchEntitlement.g.cs new file mode 100644 index 00000000..eb3757c2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetDeepResearchEntitlement.g.cs @@ -0,0 +1,17 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Deep Research Entitlement + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1GetDeepResearchEntitlementAsync( + 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.V1GetDeepResearchRun.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetDeepResearchRun.g.cs new file mode 100644 index 00000000..70ce14bd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetDeepResearchRun.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Deep Research Run
+ /// Return the current run state, or SSE-stream if ``stream=true``.
+ /// Streaming lets clients reconnect to an in-progress run after a network
+ /// drop without creating a duplicate execution. The stream replays the
+ /// execution tracer from the current cursor and terminates with a ``result``
+ /// event once the run settles (or the run is already terminal).
+ /// Clients that want to resume from a specific position in the event stream
+ /// should send the standard SSE ``Last-Event-ID`` header; the tracer will
+ /// replay only events after that id (see systems-execution-tracer
+ /// ``events-stream`` endpoint). + ///
+ /// + /// + /// 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 V1GetDeepResearchRunAsync( + string executionId, + bool? stream = default, + string? lastEventId = 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.V1GetDeepResearchStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetDeepResearchStatus.g.cs new file mode 100644 index 00000000..6b0860b1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetDeepResearchStatus.g.cs @@ -0,0 +1,17 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Deep Research 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 V1GetDeepResearchStatusAsync( + 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..83883f00 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..616c255c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs @@ -9,11 +9,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 V1GetPlanAsync( 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..0437c76a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs @@ -9,11 +9,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 V1GetRouteAsync( 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..8e277d2e 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..27ee165f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs @@ -7,9 +7,11 @@ 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); } } \ 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..88223c0a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..9706b253 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs @@ -9,11 +9,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 V1ListRoutesAsync( 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..a0c3447b 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs @@ -8,11 +8,13 @@ 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 @@ -51,6 +53,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 +74,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..f008400c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs @@ -9,12 +9,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 V1ModifyAssistantAsync( string assistantId, global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Assistant @@ -42,6 +44,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 +63,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..5e0552f0 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,7 @@ public partial interface IAi21Client string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Plan @@ -25,6 +27,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 +35,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..ea55fb3c 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,7 @@ public partial interface IAi21Client string assistantId, global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Route @@ -25,6 +27,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 +35,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..74d9eb45 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs @@ -9,12 +9,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 V1RunAssistantAsync( string assistantId, global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Run Assistant @@ -38,6 +40,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 +53,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.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotyProductLookup.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotyProductLookup.g.cs index 975cbeb0..83f338df 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotyProductLookup.g.cs @@ -7,9 +7,11 @@ 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 ClarotyProductLookupSolutionsClarotyProductLookupPostAsync( + global::System.Threading.Tasks.Task V1SolutionsClarotyProductLookupAsync( + 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.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotySuggestVendorModel.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotySuggestVendorModel.g.cs index b99eab2c..2a54e81c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsClarotySuggestVendorModel.g.cs @@ -7,9 +7,11 @@ 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 ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync( + global::System.Threading.Tasks.Task V1SolutionsClarotySuggestVendorModelAsync( + 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.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs index 7b9f6ce2..2a6ce40a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs @@ -7,9 +7,11 @@ 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 FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsAsync( + 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.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs index cd7e80e2..2eb93330 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsResultsAsync( 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.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs index a12a801f..29e924c0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsStatusAsync( 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.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs index 5d44832d..ea8e033d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs @@ -7,9 +7,11 @@ 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 FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsAsync( + 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.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs index 0db37f9e..3b0f2ac3 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsResultsAsync( 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.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs index 45a2c87f..464002a5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsStatusAsync( 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.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs index 1c74289d..0b27a50d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs @@ -7,9 +7,11 @@ 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 FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsAsync( + 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.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs index 23b18f54..25009a5b 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync( 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.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs index acdafbea..82654d50 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync( 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.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs index 531fddac..3053f711 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs @@ -7,9 +7,11 @@ 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 FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsAsync( + 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.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs index 86d04b82..79ecad23 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync( 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.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs index e7d370d1..b6db8e47 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs @@ -8,10 +8,12 @@ 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 FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync( 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.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs index 4bc21ddc..3d047403 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs @@ -7,9 +7,11 @@ 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 FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictAsync( + 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.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs index 536d7e54..7934d95e 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs @@ -8,10 +8,12 @@ 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 FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictStatusAsync( 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.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs index 5f04022d..e19d6f07 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs @@ -7,9 +7,11 @@ 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 FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictAsync( + 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.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs similarity index 60% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs index f86b0e94..36fab8af 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs @@ -8,10 +8,12 @@ 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 FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync( 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.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs index c272a2e6..97d96642 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs @@ -7,9 +7,11 @@ 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 FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1ClassificationsAsync( + 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.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs index 3e822f5d..1fca5405 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs @@ -7,9 +7,11 @@ 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 FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync( + 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.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs index 2a8f991e..48c64dd7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs @@ -7,9 +7,11 @@ 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 FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync( + 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.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs index 11342276..9bfb2b68 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs @@ -7,9 +7,11 @@ 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 FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DescriptionsAsync( + 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.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs index 946994c3..2865a167 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs @@ -7,9 +7,11 @@ 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 FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacV1ClassificationsAsync( + 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.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs index 639b822d..b7b4c8f2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs @@ -7,9 +7,11 @@ 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 FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedClassificationsAsync( + 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.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs index 42595781..386eb770 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs @@ -7,9 +7,11 @@ 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 FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedDescriptionsAsync( + 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.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs index b7b9ea4f..7507e21a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs @@ -7,9 +7,11 @@ 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 FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsFnacV1DescriptionsAsync( + 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.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshDocumentUploadProcess.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshDocumentUploadProcess.g.cs index 394244e0..2d9cfa4e 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshDocumentUploadProcess.g.cs @@ -7,9 +7,11 @@ 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 KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshDocumentUploadProcessAsync( + 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.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshEmailAssistant.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshEmailAssistant.g.cs index 5c144142..d26e7ffb 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshEmailAssistant.g.cs @@ -7,9 +7,11 @@ 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 KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshEmailAssistantAsync( + 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.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs index fe3ab6fe..552c989f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshFundingAndCategorizationCheck.g.cs @@ -7,9 +7,11 @@ 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 KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshFundingAndCategorizationCheckAsync( + 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.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantCompliance.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantCompliance.g.cs index 1dab2ebd..cee6a7cc 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantCompliance.g.cs @@ -7,9 +7,11 @@ 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 KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshGrantComplianceAsync( + 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.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantMetadata.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantMetadata.g.cs index 6557e8e7..167bb8d6 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshGrantMetadata.g.cs @@ -7,9 +7,11 @@ 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 KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshGrantMetadataAsync( + 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.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs index c5f7346d..e7cf0d61 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewDocumentUploadProcess.g.cs @@ -7,9 +7,11 @@ 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 KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewDocumentUploadProcessAsync( + 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.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs index 6e516348..d7705123 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewEmailAssistant.g.cs @@ -7,9 +7,11 @@ 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 KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewEmailAssistantAsync( + 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.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs index 90e56218..390076e5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewFundingAndCategorizationCheck.g.cs @@ -7,9 +7,11 @@ 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 KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewFundingAndCategorizationCheckAsync( + 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.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs index c3f430ab..5994dea0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantCompliance.g.cs @@ -7,9 +7,11 @@ 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 KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewGrantComplianceAsync( + 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.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs index a2790cbd..6ae5b81b 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewGrantMetadata.g.cs @@ -7,9 +7,11 @@ 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 KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewGrantMetadataAsync( + 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.V1SolutionsKirshPreviewPublicInformationCheck.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs index 8fa0e0a5..628e6c60 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPreviewPublicInformationCheck.g.cs @@ -7,9 +7,11 @@ 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 KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshPreviewPublicInformationCheckAsync( + 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.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPublicInformationCheck.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPublicInformationCheck.g.cs index 147906d2..11259d04 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsKirshPublicInformationCheck.g.cs @@ -7,9 +7,11 @@ 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 KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync( + global::System.Threading.Tasks.Task V1SolutionsKirshPublicInformationCheckAsync( + 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.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs index 6ce2a45f..e91cb003 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs @@ -7,9 +7,11 @@ 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 TlvConvragSolutionsTlvMunicipalityConvragPostAsync( + global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityConvragAsync( + 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.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs index 82a9ca18..00d360c8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs @@ -7,9 +7,11 @@ 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 TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync( + global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityPreviewConvragAsync( + 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.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaActionItems.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaActionItems.g.cs index 7001790e..5eb697d4 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaActionItems.g.cs @@ -7,9 +7,11 @@ 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 VidaaActionItemsSolutionsVidaaActionItemsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaActionItemsAsync( + 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.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaApiMessages.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaApiMessages.g.cs index eba58d33..fa8256d8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaApiMessages.g.cs @@ -7,9 +7,11 @@ 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 VidaaMessagesSolutionsVidaaApiMessagesPostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaApiMessagesAsync( + 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..1626e0f5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentApiMessages.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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.V1SolutionsVidaaContentBrief.g.cs similarity index 52% rename from src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBrief.g.cs index 7a009de4..2dde399c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBrief.g.cs @@ -5,11 +5,13 @@ namespace AI21 public partial interface IAi21Client { /// - /// Claroty Scrape Url + /// 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 ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaContentBriefAsync( + 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..2cda5054 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobs.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..0f6e4a31 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefJobsStatus.g.cs @@ -0,0 +1,19 @@ +#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); + } +} \ 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..f9f3ffcd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentBriefScheduled.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..ed5e6ff5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscribe.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..31778f61 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentSubscriptions.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..29df251e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaContentUnsubscribe.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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.V1SolutionsVidaaFeedItems.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaFeedItems.g.cs index ef82e444..5a1602a3 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaFeedItems.g.cs @@ -7,9 +7,11 @@ 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 VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaFeedItemsAsync( + 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.V1SolutionsVidaaPreviewActionItems.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewActionItems.g.cs index af6c2bd5..61aba1df 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewActionItems.g.cs @@ -7,9 +7,11 @@ 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 VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewActionItemsAsync( + 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.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewApiMessages.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewApiMessages.g.cs index 000866dc..f3d115f0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewApiMessages.g.cs @@ -7,9 +7,11 @@ 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 VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewApiMessagesAsync( + 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..8c2cbc0a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentApiMessages.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..200cb9f3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBrief.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..cd0ae772 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobs.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..620b188f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefJobsStatus.g.cs @@ -0,0 +1,19 @@ +#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); + } +} \ 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..9ddc9a61 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentBriefScheduled.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..7a357b9f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscribe.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..6a6ba2b7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentSubscriptions.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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..9713b0c0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewContentUnsubscribe.g.cs @@ -0,0 +1,17 @@ +#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); + } +} \ 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.V1SolutionsVidaaPreviewFeedItems.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewFeedItems.g.cs index 11c3c89b..c5865a90 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewFeedItems.g.cs @@ -7,9 +7,11 @@ 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 VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewFeedItemsAsync( + 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.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs index 4ce6d5ce..7b5fd4fc 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSchedulerStats.g.cs @@ -7,9 +7,11 @@ 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 VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSchedulerStatsAsync( + 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.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSources.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSources.g.cs index 1fe458a2..545d59f5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSources.g.cs @@ -7,9 +7,11 @@ 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 VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSourcesAsync( + 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.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscribe.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscribe.g.cs index 2f6b614a..a70a96b6 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscribe.g.cs @@ -7,9 +7,11 @@ 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 VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSubscribeAsync( + 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.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs index eca05fea..25e58b94 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSubscriptions.g.cs @@ -7,9 +7,11 @@ 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 VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSubscriptionsAsync( + 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.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSummarize.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSummarize.g.cs index c9ae60f9..71f751f0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewSummarize.g.cs @@ -7,9 +7,11 @@ 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 VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewSummarizeAsync( + 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.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs index 07921c42..b76f9574 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewTriggerPoll.g.cs @@ -7,9 +7,11 @@ 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 VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewTriggerPollAsync( + 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.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs similarity index 56% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs index 8a63bb2c..e48bdbd6 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaPreviewUnsubscribe.g.cs @@ -7,9 +7,11 @@ 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 VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaPreviewUnsubscribeAsync( + 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.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSchedulerStats.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSchedulerStats.g.cs index 6e8265b0..b11911ae 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSchedulerStats.g.cs @@ -7,9 +7,11 @@ 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 VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaSchedulerStatsAsync( + 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.VidaaSourcesSolutionsVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSources.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSources.g.cs index cbfc2328..21b66655 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSources.g.cs @@ -7,9 +7,11 @@ 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 VidaaSourcesSolutionsVidaaSourcesGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaSourcesAsync( + 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.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscribe.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscribe.g.cs index e7b03f17..10e26e2a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscribe.g.cs @@ -7,9 +7,11 @@ 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 VidaaSubscribeSolutionsVidaaSubscribePostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaSubscribeAsync( + 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.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscriptions.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscriptions.g.cs index b15401d6..17ab577b 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSubscriptions.g.cs @@ -7,9 +7,11 @@ 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 VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaSubscriptionsAsync( + 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.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSummarize.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSummarize.g.cs index 71909ad7..03c933ba 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaSummarize.g.cs @@ -7,9 +7,11 @@ 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 VidaaSummarizeSolutionsVidaaSummarizePostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaSummarizeAsync( + 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.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaTriggerPoll.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaTriggerPoll.g.cs index 393e0fa0..df247083 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaTriggerPoll.g.cs @@ -7,9 +7,11 @@ 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 VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaTriggerPollAsync( + 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.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaUnsubscribe.g.cs similarity index 57% rename from src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs rename to src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaUnsubscribe.g.cs index f51de598..a3eedcc3 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsVidaaUnsubscribe.g.cs @@ -7,9 +7,11 @@ 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 VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync( + global::System.Threading.Tasks.Task V1SolutionsVidaaUnsubscribeAsync( + 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..1bb9105d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs @@ -8,20 +8,24 @@ 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 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..f12ed4ce 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs @@ -8,20 +8,24 @@ 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 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..8557a4cb 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs @@ -9,12 +9,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, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Validate Plan @@ -22,12 +24,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.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..88df1906 100644 --- a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs @@ -13,11 +13,13 @@ 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
@@ -86,6 +88,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 +104,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..8b05e778 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs @@ -11,10 +11,12 @@ 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); } } \ 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..35e70ad5 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,7 @@ 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); } } \ 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..04aaa98c 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs @@ -16,10 +16,12 @@ 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); } } \ 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..834c0248 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs @@ -17,12 +17,14 @@ 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
@@ -45,12 +47,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..e84f4f03 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs @@ -14,11 +14,13 @@ 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
@@ -41,6 +43,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 +57,7 @@ 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); } } \ 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..561cb4db 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..a83ddb53 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..7ce993e9 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs @@ -9,10 +9,12 @@ 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); } } \ 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..360dada0 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs @@ -8,11 +8,13 @@ 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 @@ -34,6 +36,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 +51,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..6efa2009 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs @@ -7,9 +7,11 @@ 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); } } \ 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..52d55aca 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs @@ -8,22 +8,26 @@ 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 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..54378b57 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..270920f4 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs @@ -9,12 +9,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, global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Secret @@ -22,12 +24,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..19239b82 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs @@ -8,11 +8,13 @@ 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 @@ -27,6 +29,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 +39,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..125054da 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..20d2af3a 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..d0eb6a87 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs @@ -8,10 +8,12 @@ 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); } } \ 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..143b5984 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs @@ -8,20 +8,24 @@ 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 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..0369bd1b 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs @@ -8,11 +8,13 @@ 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 @@ -20,12 +22,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..b4addc9f 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs @@ -8,20 +8,24 @@ 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 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..cd342feb 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +73,43 @@ 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: true); + + 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 +119,315 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.AnyOf>.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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 +496,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 +512,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 +533,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..da78efc3 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,37 @@ 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. + /// 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 = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + global::AI21.AutoSDKClientOptions? options = null, 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.DeepResearchRunResultStatus.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.DeepResearchRunResultStatus.g.cs new file mode 100644 index 00000000..b8ba3aaf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.JsonConverters.DeepResearchRunResultStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace AI21.JsonConverters +{ + /// + public sealed class DeepResearchRunResultStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::AI21.DeepResearchRunResultStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::AI21.DeepResearchRunResultStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::AI21.DeepResearchRunResultStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::AI21.DeepResearchRunResultStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::AI21.DeepResearchRunResultStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::AI21.DeepResearchRunResultStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.DeepResearchRunResultStatusNullable.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.DeepResearchRunResultStatusNullable.g.cs new file mode 100644 index 00000000..6feb5454 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.JsonConverters.DeepResearchRunResultStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace AI21.JsonConverters +{ + /// + public sealed class DeepResearchRunResultStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::AI21.DeepResearchRunResultStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::AI21.DeepResearchRunResultStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::AI21.DeepResearchRunResultStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::AI21.DeepResearchRunResultStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::AI21.DeepResearchRunResultStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::AI21.DeepResearchRunResultStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs b/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs index ef287e0c..0c4052ed 100644 --- a/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs @@ -57,6 +57,10 @@ namespace AI21 typeof(global::AI21.JsonConverters.CreateMaestroRunsPayloadResponseLanguageNullableJsonConverter), + typeof(global::AI21.JsonConverters.DeepResearchRunResultStatusJsonConverter), + + typeof(global::AI21.JsonConverters.DeepResearchRunResultStatusNullableJsonConverter), + typeof(global::AI21.JsonConverters.DemoStatusJsonConverter), typeof(global::AI21.JsonConverters.DemoStatusNullableJsonConverter), @@ -287,6 +291,7 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ToolCallDelta))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ToolCallDeltaStart))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CitationItem))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CompareTextRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ComparisonOperator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorConnectionStatus))] @@ -299,6 +304,7 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorsSyncParams))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorsToken))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateAssistantRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateDeepResearchPayload))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateMCPStorageRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateMaestroRunsPayload))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.AnyOf, string>), TypeInfoPropertyName = "AnyOfIListMessageString2")] @@ -314,6 +320,16 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreatePlanPayload))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateRoutePayload))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateSecretPayload))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeepResearchCandidate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeepResearchEnabled))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeepResearchEntitlement))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeepResearchError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeepResearchResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.RubricsSummary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeepResearchRunResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeepResearchRunResultStatus), TypeInfoPropertyName = "DeepResearchRunResultStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeleteAssistantResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DeleteMCPStorageResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.Demo))] @@ -465,6 +481,8 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs b/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs index 550dad63..810d870f 100644 --- a/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs @@ -320,627 +320,675 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::AI21.CompareTextRequest? Type73 { get; set; } + public global::AI21.CitationItem? Type73 { get; set; } /// /// /// - public global::AI21.ComparisonOperator? Type74 { get; set; } + public global::AI21.CompareTextRequest? Type74 { get; set; } /// /// /// - public global::AI21.ConnectorConnectionStatus? Type75 { get; set; } + public global::AI21.ComparisonOperator? Type75 { get; set; } /// /// /// - public global::AI21.ParagonSyncStatus? Type76 { get; set; } + public global::AI21.ConnectorConnectionStatus? Type76 { get; set; } /// /// /// - public global::AI21.ConnectorsDataSources? Type77 { get; set; } + public global::AI21.ParagonSyncStatus? Type77 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type78 { get; set; } + public global::AI21.ConnectorsDataSources? Type78 { get; set; } /// /// /// - public global::AI21.DataSourceMetadata? Type79 { get; set; } + public global::System.Collections.Generic.IList? Type79 { get; set; } /// /// /// - public global::AI21.ConnectorsStatus? Type80 { get; set; } + public global::AI21.DataSourceMetadata? Type80 { get; set; } /// /// /// - public global::AI21.ConnectorsWorkflowStatus? Type81 { get; set; } + public global::AI21.ConnectorsStatus? Type81 { get; set; } /// /// /// - public global::AI21.ConnectorsSyncParams? Type82 { get; set; } + public global::AI21.ConnectorsWorkflowStatus? Type82 { get; set; } /// /// /// - public global::AI21.ConnectorsToken? Type83 { get; set; } + public global::AI21.ConnectorsSyncParams? Type83 { get; set; } /// /// /// - public global::AI21.CreateAssistantRequest? Type84 { get; set; } + public global::AI21.ConnectorsToken? Type84 { get; set; } /// /// /// - public global::AI21.CreateMCPStorageRequest? Type85 { get; set; } + public global::AI21.CreateAssistantRequest? Type85 { get; set; } /// /// /// - public global::AI21.CreateMaestroRunsPayload? Type86 { get; set; } + public global::AI21.CreateDeepResearchPayload? Type86 { get; set; } /// /// /// - public global::AI21.AnyOf, string>? Type87 { get; set; } + public global::AI21.CreateMCPStorageRequest? Type87 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type88 { get; set; } + public global::AI21.CreateMaestroRunsPayload? Type88 { get; set; } /// /// /// - public global::AI21.Message? Type89 { get; set; } + public global::AI21.AnyOf, string>? Type89 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type90 { get; set; } + public global::System.Collections.Generic.IList? Type90 { get; set; } /// /// /// - public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineRequirement? Type91 { get; set; } + public global::AI21.Message? Type91 { get; set; } /// /// /// - public global::AI21.CreateMaestroRunsPayloadBudget? Type92 { get; set; } + public global::System.Collections.Generic.IList? Type92 { get; set; } /// /// /// - public global::AI21.CreateMaestroRunsPayloadVariant? Type93 { get; set; } + public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineRequirement? Type93 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type94 { get; set; } + public global::AI21.CreateMaestroRunsPayloadBudget? Type94 { get; set; } /// /// /// - public global::AI21.CreateMaestroRunsPayloadResponseLanguage? Type95 { get; set; } + public global::AI21.CreateMaestroRunsPayloadVariant? Type95 { get; set; } /// /// /// - public global::AI21.CreateOrganizationSchemaRequest? Type96 { get; set; } + public global::System.Collections.Generic.IList? Type96 { get; set; } /// /// /// - public global::AI21.CreatePlanPayload? Type97 { get; set; } + public global::AI21.CreateMaestroRunsPayloadResponseLanguage? Type97 { get; set; } /// /// /// - public global::AI21.CreateRoutePayload? Type98 { get; set; } + public global::AI21.CreateOrganizationSchemaRequest? Type98 { get; set; } /// /// /// - public global::AI21.CreateSecretPayload? Type99 { get; set; } + public global::AI21.CreatePlanPayload? Type99 { get; set; } /// /// /// - public global::AI21.DeleteAssistantResponse? Type100 { get; set; } + public global::AI21.CreateRoutePayload? Type100 { get; set; } /// /// /// - public global::AI21.DeleteMCPStorageResponse? Type101 { get; set; } + public global::AI21.CreateSecretPayload? Type101 { get; set; } /// /// /// - public global::AI21.Demo? Type102 { get; set; } + public global::AI21.DeepResearchCandidate? Type102 { get; set; } /// /// /// - public global::AI21.DemoVisibility? Type103 { get; set; } + public global::AI21.DeepResearchEnabled? Type103 { get; set; } /// /// /// - public global::AI21.DemoStatus? Type104 { get; set; } + public global::AI21.DeepResearchEntitlement? Type104 { get; set; } /// /// /// - public global::AI21.DemoCreate? Type105 { get; set; } + public global::AI21.DeepResearchError? Type105 { get; set; } /// /// /// - public global::AI21.DemoUpdate? Type106 { get; set; } + public global::AI21.DeepResearchResult? Type106 { get; set; } /// /// /// - public global::AI21.DetectSchemaRequest? Type107 { get; set; } + public global::System.Collections.Generic.IList? Type107 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type108 { get; set; } + public global::AI21.RubricsSummary? Type108 { get; set; } /// /// /// - public global::AI21.DocumentReference? Type109 { get; set; } + public global::System.Collections.Generic.IList? Type109 { get; set; } /// /// /// - public global::AI21.DetectSchemaResponse? Type110 { get; set; } + public global::AI21.DeepResearchRunResult? Type110 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type111 { get; set; } + public global::AI21.DeepResearchRunResultStatus? Type111 { get; set; } /// /// /// - public global::AI21.DownloadModifiedDocumentRequest? Type112 { get; set; } + public global::AI21.DeleteAssistantResponse? Type112 { get; set; } /// /// /// - public global::AI21.FileResponse? Type113 { get; set; } + public global::AI21.DeleteMCPStorageResponse? Type113 { get; set; } /// /// /// - public long? Type114 { get; set; } + public global::AI21.Demo? Type114 { get; set; } /// /// /// - public global::AI21.FileSearchToolResource? Type115 { get; set; } + public global::AI21.DemoVisibility? Type115 { get; set; } /// /// /// - public global::AI21.FileSearchToolResourceType? Type116 { get; set; } + public global::AI21.DemoStatus? Type116 { get; set; } /// /// /// - public global::AI21.FileSearchToolResourceLabelsFilterMode? Type117 { get; set; } + public global::AI21.DemoCreate? Type117 { get; set; } /// /// /// - public global::AI21.QueryFilter? Type118 { get; set; } + public global::AI21.DemoUpdate? Type118 { get; set; } /// /// /// - public global::AI21.RetrievalStrategy? Type119 { get; set; } + public global::AI21.DetectSchemaRequest? Type119 { get; set; } /// /// /// - public global::AI21.FileSearchToolResourceResponseLanguage? Type120 { get; set; } + public global::System.Collections.Generic.IList? Type120 { get; set; } /// /// /// - public global::AI21.FileStatus? Type121 { get; set; } + public global::AI21.DocumentReference? Type121 { get; set; } /// /// /// - public global::AI21.FilesUpdateRequest? Type122 { get; set; } + public global::AI21.DetectSchemaResponse? Type122 { get; set; } /// /// /// - public global::AI21.FunctionToolDefinition? Type123 { get; set; } + public global::System.Collections.Generic.Dictionary? Type123 { get; set; } /// /// /// - public global::AI21.ToolParameters? Type124 { get; set; } + public global::AI21.DownloadModifiedDocumentRequest? Type124 { get; set; } /// /// /// - public global::AI21.GenerateAssistantRequest? Type125 { get; set; } + public global::AI21.FileResponse? Type125 { get; set; } /// /// /// - public global::AI21.GenerateAssistantResponse? Type126 { get; set; } + public long? Type126 { get; set; } /// /// /// - public global::AI21.GenerateAssistantResponseResponseLanguage? Type127 { get; set; } + public global::AI21.FileSearchToolResource? Type127 { get; set; } /// /// /// - public global::AI21.HTTPToolEndpoint? Type128 { get; set; } + public global::AI21.FileSearchToolResourceType? Type128 { get; set; } /// /// /// - public global::AI21.HTTPToolFunction? Type129 { get; set; } + public global::AI21.FileSearchToolResourceLabelsFilterMode? Type129 { get; set; } /// /// /// - public global::AI21.HTTPToolFunctionParameters? Type130 { get; set; } + public global::AI21.QueryFilter? Type130 { get; set; } /// /// /// - public global::AI21.HTTPToolFunctionParamProperties? Type131 { get; set; } + public global::AI21.RetrievalStrategy? Type131 { get; set; } /// /// /// - public global::AI21.HTTPToolFunctionParametersType? Type132 { get; set; } + public global::AI21.FileSearchToolResourceResponseLanguage? Type132 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type133 { get; set; } + public global::AI21.FileStatus? Type133 { get; set; } /// /// /// - public global::AI21.HTTPToolResource? Type134 { get; set; } + public global::AI21.FilesUpdateRequest? Type134 { get; set; } /// /// /// - public global::AI21.HTTPToolResourceType? Type135 { get; set; } + public global::AI21.FunctionToolDefinition? Type135 { get; set; } /// /// /// - public global::AI21.HTTPValidationError? Type136 { get; set; } + public global::AI21.ToolParameters? Type136 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type137 { get; set; } + public global::AI21.GenerateAssistantRequest? Type137 { get; set; } /// /// /// - public global::AI21.ValidationError? Type138 { get; set; } + public global::AI21.GenerateAssistantResponse? Type138 { get; set; } /// /// /// - public global::AI21.IgnestionBatchStatusCount? Type139 { get; set; } + public global::AI21.GenerateAssistantResponseResponseLanguage? Type139 { get; set; } /// /// /// - public global::AI21.IngestionBatchStatusResponse? Type140 { get; set; } + public global::AI21.HTTPToolEndpoint? Type140 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type141 { get; set; } + public global::AI21.HTTPToolFunction? Type141 { get; set; } /// /// /// - public global::AI21.JambaExecuteRequest? Type142 { get; set; } + public global::AI21.HTTPToolFunctionParameters? Type142 { get; set; } /// /// /// - public global::AI21.LibrarySearchRequest? Type143 { get; set; } + public global::AI21.HTTPToolFunctionParamProperties? Type143 { get; set; } /// /// /// - public global::AI21.LibrarySearchRequestLabelsFilterMode? Type144 { get; set; } + public global::AI21.HTTPToolFunctionParametersType? Type144 { get; set; } /// /// /// - public global::AI21.ListAssistantsResponse? Type145 { get; set; } + public global::System.Collections.Generic.Dictionary? Type145 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type146 { get; set; } + public global::AI21.HTTPToolResource? Type146 { get; set; } /// /// /// - public global::AI21.ListMCPsStorageResponse? Type147 { get; set; } + public global::AI21.HTTPToolResourceType? Type147 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type148 { get; set; } + public global::AI21.HTTPValidationError? Type148 { get; set; } /// /// /// - public global::AI21.MCPStorageResponse? Type149 { get; set; } + public global::System.Collections.Generic.IList? Type149 { get; set; } /// /// /// - public global::AI21.ListPlansResponse? Type150 { get; set; } + public global::AI21.ValidationError? Type150 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type151 { get; set; } + public global::AI21.IgnestionBatchStatusCount? Type151 { get; set; } /// /// /// - public global::AI21.Plan? Type152 { get; set; } + public global::AI21.IngestionBatchStatusResponse? Type152 { get; set; } /// /// /// - public global::AI21.ListRoutesResponse? Type153 { get; set; } + public global::System.Collections.Generic.IList? Type153 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type154 { get; set; } + public global::AI21.JambaExecuteRequest? Type154 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? Type155 { get; set; } + public global::AI21.LibrarySearchRequest? Type155 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type156 { get; set; } + public global::AI21.LibrarySearchRequestLabelsFilterMode? Type156 { get; set; } /// /// /// - public global::AI21.LogprobsData? Type157 { get; set; } + public global::AI21.ListAssistantsResponse? Type157 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type158 { get; set; } + public global::System.Collections.Generic.IList? Type158 { get; set; } /// /// /// - public global::AI21.TopLogprobsData? Type159 { get; set; } + public global::AI21.ListMCPsStorageResponse? Type159 { get; set; } /// /// /// - public global::AI21.MCPDefinition? Type160 { get; set; } + public global::System.Collections.Generic.IList? Type160 { get; set; } /// /// /// - public global::AI21.MCPDiscoveryResponse? Type161 { get; set; } + public global::AI21.MCPStorageResponse? Type161 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type162 { get; set; } + public global::AI21.ListPlansResponse? Type162 { get; set; } /// /// /// - public global::AI21.MCPTool? Type163 { get; set; } + public global::System.Collections.Generic.IList? Type163 { get; set; } /// /// /// - public global::AI21.MCPToolResource? Type164 { get; set; } + public global::AI21.Plan? Type164 { get; set; } /// /// /// - public global::AI21.MCPToolResourceType? Type165 { get; set; } + public global::AI21.ListRoutesResponse? Type165 { get; set; } /// /// /// - public global::AI21.MaestroRunError? Type166 { get; set; } + public global::System.Collections.Generic.IList? Type166 { get; set; } /// /// /// - public global::AI21.MaestroRunResult? Type167 { get; set; } + public global::System.Collections.Generic.Dictionary>? Type167 { get; set; } /// /// /// - public global::AI21.MaestroRunResultStatus? Type168 { get; set; } + public global::System.Collections.Generic.IList? Type168 { get; set; } /// /// /// - public global::AI21.MarkdownRequest? Type169 { get; set; } + public global::AI21.LogprobsData? Type169 { get; set; } /// /// /// - public global::AI21.MessageRole? Type170 { get; set; } + public global::System.Collections.Generic.IList? Type170 { get; set; } /// /// /// - public global::AI21.ModelInfo? Type171 { get; set; } + public global::AI21.TopLogprobsData? Type171 { get; set; } /// /// /// - public global::AI21.ModelQuantization? Type172 { get; set; } + public global::AI21.MCPDefinition? Type172 { get; set; } /// /// /// - public global::AI21.ModelPricing? Type173 { get; set; } + public global::AI21.MCPDiscoveryResponse? Type173 { get; set; } /// /// /// - public global::AI21.ModelsInfoResponse? Type174 { get; set; } + public global::System.Collections.Generic.IList? Type174 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type175 { get; set; } + public global::AI21.MCPTool? Type175 { get; set; } /// /// /// - public global::AI21.ModifyAssistantRequest? Type176 { get; set; } + public global::AI21.MCPToolResource? Type176 { get; set; } /// /// /// - public global::AI21.RunOptimization? Type177 { get; set; } + public global::AI21.MCPToolResourceType? Type177 { get; set; } /// /// /// - public global::AI21.ModifyAssistantRequestResponseLanguage? Type178 { get; set; } + public global::AI21.MaestroRunError? Type178 { get; set; } /// /// /// - public global::AI21.OrgSchema? Type179 { get; set; } + public global::AI21.MaestroRunResult? Type179 { get; set; } /// /// /// - public global::AI21.OrgSchemas? Type180 { get; set; } + public global::AI21.MaestroRunResultStatus? Type180 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type181 { get; set; } + public global::AI21.MarkdownRequest? Type181 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type182 { get; set; } + public global::AI21.MessageRole? Type182 { get; set; } /// /// /// - public global::AI21.RFIResponseSection? Type183 { get; set; } + public global::AI21.ModelInfo? Type183 { get; set; } /// /// /// - public global::AI21.RequirementItem? Type184 { get; set; } + public global::AI21.ModelQuantization? Type184 { get; set; } /// /// /// - public global::AI21.RequirementsGenerationRequest? Type185 { get; set; } + public global::AI21.ModelPricing? Type185 { get; set; } /// /// /// - public global::AI21.RequirementsGenerationResponse? Type186 { get; set; } + public global::AI21.ModelsInfoResponse? Type186 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type187 { get; set; } + public global::System.Collections.Generic.IList? Type187 { get; set; } /// /// /// - public global::AI21.ResponseFormatType? Type188 { get; set; } + public global::AI21.ModifyAssistantRequest? Type188 { get; set; } /// /// /// - public global::AI21.RunAssistantRequest? Type189 { get; set; } + public global::AI21.RunOptimization? Type189 { get; set; } /// /// /// - public global::AI21.RunAssistantRequestResponseLanguage? Type190 { get; set; } + public global::AI21.ModifyAssistantRequestResponseLanguage? Type190 { get; set; } /// /// /// - public global::AI21.SecretResponse? Type191 { get; set; } + public global::AI21.OrgSchema? Type191 { get; set; } /// /// /// - public global::AI21.SystemMessageRole? Type192 { get; set; } + public global::AI21.OrgSchemas? Type192 { get; set; } /// /// /// - public global::AI21.ThreadNameGenerationRequest? Type193 { get; set; } + public global::System.Collections.Generic.IList? Type193 { get; set; } /// /// /// - public global::AI21.ThreadNameGenerationResponse? Type194 { get; set; } + public global::System.Collections.Generic.Dictionary? Type194 { get; set; } /// /// /// - public global::AI21.ToolCallType? Type195 { get; set; } + public global::AI21.RFIResponseSection? Type195 { get; set; } /// /// /// - public global::AI21.ToolFunction? Type196 { get; set; } + public global::AI21.RequirementItem? Type196 { get; set; } /// /// /// - public global::AI21.ToolFunctionDelta? Type197 { get; set; } + public global::AI21.RequirementsGenerationRequest? Type197 { get; set; } /// /// /// - public global::AI21.ToolCallDeltaStartType? Type198 { get; set; } + public global::AI21.RequirementsGenerationResponse? Type198 { get; set; } /// /// /// - public global::AI21.ToolFunctionDeltaStart? Type199 { get; set; } + public global::System.Collections.Generic.IList? Type199 { get; set; } /// /// /// - public global::AI21.ToolMessageRole? Type200 { get; set; } + public global::AI21.ResponseFormatType? Type200 { get; set; } /// /// /// - public global::AI21.ToolParametersType? Type201 { get; set; } + public global::AI21.RunAssistantRequest? Type201 { get; set; } /// /// /// - public global::AI21.UpdateMCPStorageRequest? Type202 { get; set; } + public global::AI21.RunAssistantRequestResponseLanguage? Type202 { get; set; } /// /// /// - public global::AI21.UpdateRoutePayload? Type203 { get; set; } + public global::AI21.SecretResponse? Type203 { get; set; } /// /// /// - public global::AI21.UpdateSecretPayload? Type204 { get; set; } + public global::AI21.SystemMessageRole? Type204 { get; set; } /// /// /// - public global::AI21.UserMessageRole? Type205 { get; set; } + public global::AI21.ThreadNameGenerationRequest? Type205 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type206 { get; set; } + public global::AI21.ThreadNameGenerationResponse? Type206 { get; set; } /// /// /// - public global::AI21.AnyOf? Type207 { get; set; } + public global::AI21.ToolCallType? Type207 { get; set; } /// /// /// - public global::AI21.ValidationResult? Type208 { get; set; } + public global::AI21.ToolFunction? Type208 { get; set; } /// /// /// - public global::AI21.WebSearchToolResource? Type209 { get; set; } + public global::AI21.ToolFunctionDelta? Type209 { get; set; } /// /// /// - public global::AI21.WebSearchToolResourceType? Type210 { get; set; } + public global::AI21.ToolCallDeltaStartType? Type210 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorCreateConfigPayload? Type211 { get; set; } + public global::AI21.ToolFunctionDeltaStart? Type211 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorIngestUrlPayload? Type212 { get; set; } + public global::AI21.ToolMessageRole? Type212 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorIngestWebsitePayload? Type213 { get; set; } + public global::AI21.ToolParametersType? Type213 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorPayload? Type214 { get; set; } + public global::AI21.UpdateMCPStorageRequest? Type214 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorPayloadType? Type215 { get; set; } + public global::AI21.UpdateRoutePayload? Type215 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorRetryIngestWebsitePayload? Type216 { get; set; } + public global::AI21.UpdateSecretPayload? Type216 { get; set; } /// /// /// - public global::AI21.WorkspaceModelResponse? Type217 { get; set; } + public global::AI21.UserMessageRole? Type217 { get; set; } /// /// /// - public global::AI21.WorkspaceModelUpdate? Type218 { get; set; } + public global::System.Collections.Generic.IList>? Type218 { get; set; } /// /// /// - public global::AI21.WorkspaceModelsResponse? Type219 { get; set; } + public global::AI21.AnyOf? Type219 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type220 { get; set; } + public global::AI21.ValidationResult? Type220 { get; set; } /// /// /// - public global::AI21.LanguageStudioApiServerDataTypesChatToolDefinitionType? Type221 { get; set; } + public global::AI21.WebSearchToolResource? Type221 { get; set; } /// /// /// - public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator? Type222 { get; set; } + public global::AI21.WebSearchToolResourceType? Type222 { get; set; } /// /// /// - public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType? Type223 { get; set; } + public global::AI21.WebsiteConnectorCreateConfigPayload? Type223 { get; set; } /// /// /// - public global::AI21.AnyOf>? Type224 { get; set; } + public global::AI21.WebsiteConnectorIngestUrlPayload? Type224 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type225 { get; set; } + public global::AI21.WebsiteConnectorIngestWebsitePayload? Type225 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type226 { get; set; } + public global::AI21.WebsiteConnectorPayload? Type226 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type227 { get; set; } + public global::AI21.WebsiteConnectorPayloadType? Type227 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type228 { get; set; } + public global::AI21.WebsiteConnectorRetryIngestWebsitePayload? Type228 { get; set; } + /// + /// + /// + public global::AI21.WorkspaceModelResponse? Type229 { get; set; } + /// + /// + /// + public global::AI21.WorkspaceModelUpdate? Type230 { get; set; } + /// + /// + /// + public global::AI21.WorkspaceModelsResponse? Type231 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type232 { get; set; } + /// + /// + /// + public global::AI21.LanguageStudioApiServerDataTypesChatToolDefinitionType? Type233 { get; set; } + /// + /// + /// + public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator? Type234 { get; set; } + /// + /// + /// + public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType? Type235 { get; set; } + /// + /// + /// + public global::AI21.AnyOf>? Type236 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type237 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type238 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type239 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type240 { get; set; } /// /// @@ -1033,86 +1081,94 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType23 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType28 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType29 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType28 { get; set; } + public global::System.Collections.Generic.List? ListType30 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? ListType29 { get; set; } + public global::System.Collections.Generic.Dictionary>? ListType31 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType30 { get; set; } + public global::System.Collections.Generic.List? ListType32 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType33 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType34 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType35 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType36 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::System.Collections.Generic.List? ListType37 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType36 { get; set; } + public global::System.Collections.Generic.List>? ListType38 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType37 { get; set; } + public global::System.Collections.Generic.List? ListType39 { get; set; } /// /// /// - public global::AI21.AnyOf>? ListType38 { get; set; } + public global::AI21.AnyOf>? ListType40 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List? ListType41 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType42 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType43 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType42 { get; set; } + public global::System.Collections.Generic.List? ListType44 { get; set; } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs index 16ed4c45..6ee82c32 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,12 @@ 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) { PrepareArguments( @@ -65,22 +68,43 @@ 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 +114,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..97fc761b 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,7 @@ 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) { PrepareArguments( @@ -93,30 +96,51 @@ 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 +150,314 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + 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 new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + (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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..3fff67f1 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,12 @@ 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) { PrepareArguments( @@ -70,22 +73,43 @@ 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 +119,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 + global::AI21.FileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..e1e98089 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,14 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -78,22 +81,43 @@ 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 +127,312 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +455,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 +474,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..975a78f3 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -71,22 +74,43 @@ 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: true); + + 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,213 +120,400 @@ 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) - { - - __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}"), - name: "\"publicUrl\""); - } - if (request.CustomConfigs != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.CustomConfigs}"), - name: "\"custom_configs\""); - } - if (request.UploadMode != 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($"{request.BatchId}"), - name: "\"batch_id\""); - } - if (request.DataSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.DataSource}"), - name: "\"data_source\""); - } - if (request.Metadata != 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; + } + 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); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Metadata}"), - name: "\"metadata\""); + return __httpRequest; } - __httpRequest.Content = __httpRequestContent; - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryUploadRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryUploadResponse( - 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: "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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - 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) - { - } + // 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 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 (__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 new global::AI21.ApiException( + message: __content ?? __response.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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Upload Workspace File
@@ -325,6 +536,7 @@ 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( @@ -338,6 +550,7 @@ 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 @@ -356,6 +569,7 @@ partial void ProcessV1LibraryUploadResponseContent( return await V1LibraryUploadAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs index 167b6395..c16f889e 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,37 @@ 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. + /// 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 = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + global::AI21.AutoSDKClientOptions? options = null, 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.CitationItem.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CitationItem.Json.g.cs new file mode 100644 index 00000000..c00b6b15 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CitationItem.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class CitationItem + { + /// + /// 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.CitationItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.CitationItem), + jsonSerializerContext) as global::AI21.CitationItem; + } + + /// + /// 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.CitationItem? 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.CitationItem), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CitationItem; + } + + /// + /// 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.CitationItem.g.cs b/src/libs/AI21/Generated/AI21.Models.CitationItem.g.cs new file mode 100644 index 00000000..ced19f54 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CitationItem.g.cs @@ -0,0 +1,72 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class CitationItem + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ref")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Ref { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("snippet")] + public string? Snippet { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CitationItem( + int @ref, + string url, + string? title, + string? snippet) + { + this.Ref = @ref; + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.Title = title; + this.Snippet = snippet; + } + + /// + /// Initializes a new instance of the class. + /// + public CitationItem() + { + } + } +} \ 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.CreateDeepResearchPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateDeepResearchPayload.Json.g.cs new file mode 100644 index 00000000..7e4541ae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CreateDeepResearchPayload.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class CreateDeepResearchPayload + { + /// + /// 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.CreateDeepResearchPayload? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.CreateDeepResearchPayload), + jsonSerializerContext) as global::AI21.CreateDeepResearchPayload; + } + + /// + /// 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.CreateDeepResearchPayload? 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.CreateDeepResearchPayload), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateDeepResearchPayload; + } + + /// + /// 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.CreateDeepResearchPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateDeepResearchPayload.g.cs new file mode 100644 index 00000000..956531b9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CreateDeepResearchPayload.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class CreateDeepResearchPayload + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("budget_cost")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double BudgetCost { get; set; } + + /// + /// Whether or not to stream the result one token at a time using
+ /// [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
+ /// This can be useful when waiting for long results where a long wait time for an
+ /// answer can be problematic, such as a chatbot. If set to `True`, then `n` must
+ /// be 1. A streaming response is different than the non-streaming response.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("stream")] + public bool? Stream { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// Whether or not to stream the result one token at a time using
+ /// [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
+ /// This can be useful when waiting for long results where a long wait time for an
+ /// answer can be problematic, such as a chatbot. If set to `True`, then `n` must
+ /// be 1. A streaming response is different than the non-streaming response.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateDeepResearchPayload( + string prompt, + double budgetCost, + bool? stream) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.BudgetCost = budgetCost; + this.Stream = stream; + } + + /// + /// Initializes a new instance of the class. + /// + public CreateDeepResearchPayload() + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeepResearchCandidate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchCandidate.Json.g.cs new file mode 100644 index 00000000..92a91a38 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchCandidate.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DeepResearchCandidate + { + /// + /// 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.DeepResearchCandidate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DeepResearchCandidate), + jsonSerializerContext) as global::AI21.DeepResearchCandidate; + } + + /// + /// 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.DeepResearchCandidate? 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.DeepResearchCandidate), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeepResearchCandidate; + } + + /// + /// 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.DeepResearchCandidate.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchCandidate.g.cs new file mode 100644 index 00000000..b82ec9c1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchCandidate.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class DeepResearchCandidate + { + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cost_usd")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double CostUsd { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("score")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Score { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("report_md")] + public string? ReportMd { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeepResearchCandidate( + string id, + double costUsd, + double score, + string? reportMd) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.CostUsd = costUsd; + this.Score = score; + this.ReportMd = reportMd; + } + + /// + /// Initializes a new instance of the class. + /// + public DeepResearchCandidate() + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeepResearchEnabled.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchEnabled.Json.g.cs new file mode 100644 index 00000000..5b7ef7f0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchEnabled.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DeepResearchEnabled + { + /// + /// 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.DeepResearchEnabled? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DeepResearchEnabled), + jsonSerializerContext) as global::AI21.DeepResearchEnabled; + } + + /// + /// 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.DeepResearchEnabled? 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.DeepResearchEnabled), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeepResearchEnabled; + } + + /// + /// 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.DeepResearchEnabled.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchEnabled.g.cs new file mode 100644 index 00000000..30e53553 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchEnabled.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class DeepResearchEnabled + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Enabled { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeepResearchEnabled( + bool enabled) + { + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public DeepResearchEnabled() + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeepResearchEntitlement.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchEntitlement.Json.g.cs new file mode 100644 index 00000000..be7cb714 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchEntitlement.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DeepResearchEntitlement + { + /// + /// 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.DeepResearchEntitlement? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DeepResearchEntitlement), + jsonSerializerContext) as global::AI21.DeepResearchEntitlement; + } + + /// + /// 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.DeepResearchEntitlement? 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.DeepResearchEntitlement), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeepResearchEntitlement; + } + + /// + /// 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.DeepResearchEntitlement.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchEntitlement.g.cs new file mode 100644 index 00000000..8199228f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchEntitlement.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class DeepResearchEntitlement + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("usage_limit")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int UsageLimit { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("current_usage")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int CurrentUsage { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("remaining")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Remaining { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("unlimited")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Unlimited { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeepResearchEntitlement( + int usageLimit, + int currentUsage, + int remaining, + bool unlimited) + { + this.UsageLimit = usageLimit; + this.CurrentUsage = currentUsage; + this.Remaining = remaining; + this.Unlimited = unlimited; + } + + /// + /// Initializes a new instance of the class. + /// + public DeepResearchEntitlement() + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeepResearchError.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchError.Json.g.cs new file mode 100644 index 00000000..c6c3c344 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DeepResearchError + { + /// + /// 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.DeepResearchError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DeepResearchError), + jsonSerializerContext) as global::AI21.DeepResearchError; + } + + /// + /// 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.DeepResearchError? 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.DeepResearchError), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeepResearchError; + } + + /// + /// 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.DeepResearchError.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchError.g.cs new file mode 100644 index 00000000..bd9f0bf5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchError.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class DeepResearchError + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeepResearchError( + string message, + string? type) + { + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public DeepResearchError() + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeepResearchResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchResult.Json.g.cs new file mode 100644 index 00000000..50e15adf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DeepResearchResult + { + /// + /// 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.DeepResearchResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DeepResearchResult), + jsonSerializerContext) as global::AI21.DeepResearchResult; + } + + /// + /// 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.DeepResearchResult? 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.DeepResearchResult), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeepResearchResult; + } + + /// + /// 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.DeepResearchResult.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchResult.g.cs new file mode 100644 index 00000000..839e69b2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchResult.g.cs @@ -0,0 +1,106 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class DeepResearchResult + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("report_md")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ReportMd { get; set; } + + /// + /// Default Value: [] + /// + [global::System.Text.Json.Serialization.JsonPropertyName("candidates")] + public global::System.Collections.Generic.IList? Candidates { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rubrics_summary")] + public global::AI21.RubricsSummary? RubricsSummary { get; set; } + + /// + /// Default Value: [] + /// + [global::System.Text.Json.Serialization.JsonPropertyName("citations")] + public global::System.Collections.Generic.IList? Citations { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("execution_viewer_url")] + public string? ExecutionViewerUrl { get; set; } + + /// + /// Default Value: false + /// + [global::System.Text.Json.Serialization.JsonPropertyName("budget_exhausted")] + public bool? BudgetExhausted { get; set; } + + /// + /// Default Value: [] + /// + [global::System.Text.Json.Serialization.JsonPropertyName("budget_exceeded_reasons")] + public global::System.Collections.Generic.IList? BudgetExceededReasons { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// Default Value: [] + /// + /// + /// + /// Default Value: [] + /// + /// + /// + /// Default Value: false + /// + /// + /// Default Value: [] + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeepResearchResult( + string reportMd, + global::System.Collections.Generic.IList? candidates, + global::AI21.RubricsSummary? rubricsSummary, + global::System.Collections.Generic.IList? citations, + string? executionViewerUrl, + bool? budgetExhausted, + global::System.Collections.Generic.IList? budgetExceededReasons) + { + this.ReportMd = reportMd ?? throw new global::System.ArgumentNullException(nameof(reportMd)); + this.Candidates = candidates; + this.RubricsSummary = rubricsSummary; + this.Citations = citations; + this.ExecutionViewerUrl = executionViewerUrl; + this.BudgetExhausted = budgetExhausted; + this.BudgetExceededReasons = budgetExceededReasons; + } + + /// + /// Initializes a new instance of the class. + /// + public DeepResearchResult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResult.Json.g.cs new file mode 100644 index 00000000..1b378095 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DeepResearchRunResult + { + /// + /// 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.DeepResearchRunResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DeepResearchRunResult), + jsonSerializerContext) as global::AI21.DeepResearchRunResult; + } + + /// + /// 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.DeepResearchRunResult? 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.DeepResearchRunResult), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeepResearchRunResult; + } + + /// + /// 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.DeepResearchRunResult.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResult.g.cs new file mode 100644 index 00000000..b3b8a3a8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResult.g.cs @@ -0,0 +1,88 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class DeepResearchRunResult + { + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.DeepResearchRunResultStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::AI21.DeepResearchRunResultStatus Status { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + public global::System.DateTime? CreatedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("result")] + public global::AI21.DeepResearchResult? Result { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public global::AI21.DeepResearchError? Error { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeepResearchRunResult( + global::System.Guid id, + global::AI21.DeepResearchRunResultStatus status, + global::System.DateTime? createdAt, + global::AI21.DeepResearchResult? result, + global::AI21.DeepResearchError? error) + { + this.Id = id; + this.Status = status; + this.CreatedAt = createdAt; + this.Result = result; + this.Error = error; + } + + /// + /// Initializes a new instance of the class. + /// + public DeepResearchRunResult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResultStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResultStatus.g.cs new file mode 100644 index 00000000..9a50b287 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DeepResearchRunResultStatus.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public enum DeepResearchRunResultStatus + { + /// + /// + /// + BudgetExhausted, + /// + /// + /// + Completed, + /// + /// + /// + Failed, + /// + /// + /// + InProgress, + /// + /// + /// + Queued, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeepResearchRunResultStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeepResearchRunResultStatus value) + { + return value switch + { + DeepResearchRunResultStatus.BudgetExhausted => "budget_exhausted", + DeepResearchRunResultStatus.Completed => "completed", + DeepResearchRunResultStatus.Failed => "failed", + DeepResearchRunResultStatus.InProgress => "in_progress", + DeepResearchRunResultStatus.Queued => "queued", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeepResearchRunResultStatus? ToEnum(string value) + { + return value switch + { + "budget_exhausted" => DeepResearchRunResultStatus.BudgetExhausted, + "completed" => DeepResearchRunResultStatus.Completed, + "failed" => DeepResearchRunResultStatus.Failed, + "in_progress" => DeepResearchRunResultStatus.InProgress, + "queued" => DeepResearchRunResultStatus.Queued, + _ => null, + }; + } + } +} \ 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.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs deleted file mode 100644 index 8e3ca11c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse - { - - /// - /// 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.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.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..eefa16db 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 { /// 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.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.g.cs similarity index 79% rename from src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.g.cs index 191c7f10..430c4e5c 100644 --- a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse + public sealed partial class KirshPublicInformationCheckJobSolutionsKirshPublicInformationCheckJobsJobIdGetResponse { /// 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..8e69cffd 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 { /// 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.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.g.cs similarity index 80% rename from src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.g.cs index 214d2ea1..8cc38baa 100644 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class ClarotyProductLookupSolutionsClarotyProductLookupPostResponse + public sealed partial class KirshPublicInformationCheckJobsSolutionsKirshPublicInformationCheckJobsPostResponse { /// 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.MaestroRunResult.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs index e84d8f97..49618bf7 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; } diff --git a/src/libs/AI21/Generated/AI21.Models.RubricsSummary.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RubricsSummary.Json.g.cs new file mode 100644 index 00000000..98583ed4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.RubricsSummary.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class RubricsSummary + { + /// + /// 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.RubricsSummary? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.RubricsSummary), + jsonSerializerContext) as global::AI21.RubricsSummary; + } + + /// + /// 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.RubricsSummary? 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.RubricsSummary), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RubricsSummary; + } + + /// + /// 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.RubricsSummary.g.cs b/src/libs/AI21/Generated/AI21.Models.RubricsSummary.g.cs new file mode 100644 index 00000000..86f98298 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.RubricsSummary.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class RubricsSummary + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("comprehensiveness")] + public double? Comprehensiveness { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("depth")] + public double? Depth { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("instruction_following")] + public double? InstructionFollowing { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("readability")] + public double? Readability { get; set; } + + /// + /// 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RubricsSummary( + double? comprehensiveness, + double? depth, + double? instructionFollowing, + double? readability) + { + this.Comprehensiveness = comprehensiveness; + this.Depth = depth; + this.InstructionFollowing = instructionFollowing; + this.Readability = readability; + } + + /// + /// Initializes a new instance of the class. + /// + public RubricsSummary() + { + } + } +} \ 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.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..ced235e0 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 { /// 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.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.g.cs index e0251fe7..f5de90ce 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsClarotySuggestVendorModelResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaSourcesSolutionsVidaaSourcesGetResponse + public sealed partial class V1SolutionsClarotySuggestVendorModelResponse { /// 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.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs index 1642222c..e9bdeb5c 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResponse { /// 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.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs new file mode 100644 index 00000000..af73411e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResultsResponse + { + + /// + /// 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.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..2acbb840 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.g.cs @@ -0,0 +1,18 @@ + +#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.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs new file mode 100644 index 00000000..2bf922a5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResponse + { + + /// + /// 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.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.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs index 842d6404..63509fd2 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaSummarizeSolutionsVidaaSummarizePostResponse + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResultsResponse { /// 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.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs new file mode 100644 index 00000000..72650f2c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1DescriptionsStatusResponse + { + + /// + /// 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.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.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..fac1fd90 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResponse + { + + /// + /// 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.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.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs index bee31302..148c4162 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse { /// 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.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs index 62c6c675..7c5ca4ff 100644 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse { /// 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.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs index 1972ba86..d5ef1727 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaSubscribeSolutionsVidaaSubscribePostResponse + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResponse { /// 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.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs new file mode 100644 index 00000000..6bf292a5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse + { + + /// + /// 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.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..2b95457b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.g.cs @@ -0,0 +1,18 @@ + +#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..15ed18c6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.g.cs @@ -0,0 +1,18 @@ + +#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..51a0d627 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.g.cs @@ -0,0 +1,18 @@ + +#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.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs new file mode 100644 index 00000000..a8214a0a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictResponse + { + + /// + /// 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.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..8596ba0f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.g.cs @@ -0,0 +1,18 @@ + +#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..29970cf1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.g.cs @@ -0,0 +1,18 @@ + +#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.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs similarity index 83% rename from src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs index 49d38b3b..71e8d268 100644 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse { /// 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..3e3ded2e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..fadbbc78 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..b1f89341 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.g.cs @@ -0,0 +1,18 @@ + +#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.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs similarity index 85% rename from src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs index d5e69cc1..3a84b81c 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaMessagesSolutionsVidaaApiMessagesPostResponse + public sealed partial class V1SolutionsFnacV1DeprecatedClassificationsResponse { /// 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..4913de0e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..510b5693 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 { /// 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..2f111e9d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshDocumentUploadProcessResponse.g.cs @@ -0,0 +1,18 @@ + +#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..ddb5fa98 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshEmailAssistantResponse.g.cs @@ -0,0 +1,18 @@ + +#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.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.g.cs index 70f13984..03829c33 100644 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshFundingAndCategorizationCheckResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class VidaaActionItemsSolutionsVidaaActionItemsPostResponse + public sealed partial class V1SolutionsKirshFundingAndCategorizationCheckResponse { /// 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..6ad4ad89 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantComplianceResponse.g.cs @@ -0,0 +1,18 @@ + +#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..51efb830 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshGrantMetadataResponse.g.cs @@ -0,0 +1,18 @@ + +#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..18a93451 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewDocumentUploadProcessResponse.g.cs @@ -0,0 +1,18 @@ + +#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..72f9f0d9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewEmailAssistantResponse.g.cs @@ -0,0 +1,18 @@ + +#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.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.g.cs new file mode 100644 index 00000000..5184a58b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsKirshPreviewFundingAndCategorizationCheckResponse + { + + /// + /// 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.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..6e453d76 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantComplianceResponse.g.cs @@ -0,0 +1,18 @@ + +#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..837f1260 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewGrantMetadataResponse.g.cs @@ -0,0 +1,18 @@ + +#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.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.g.cs index 4563db0f..97e3ceba 100644 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPreviewPublicInformationCheckResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse + public sealed partial class V1SolutionsKirshPreviewPublicInformationCheckResponse { /// 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..afce1b1e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsKirshPublicInformationCheckResponse.g.cs @@ -0,0 +1,18 @@ + +#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..8fd42955 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.g.cs @@ -0,0 +1,18 @@ + +#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.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs new file mode 100644 index 00000000..b4cdc4ae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsTlvMunicipalityPreviewConvragResponse + { + + /// + /// 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.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..2f91c3ef --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaActionItemsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..101bc82b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaApiMessagesResponse.g.cs @@ -0,0 +1,18 @@ + +#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..ca9c05d2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentApiMessagesResponse.g.cs @@ -0,0 +1,18 @@ + +#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..38af5f45 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..6b11e7eb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefJobsStatusResponse.g.cs @@ -0,0 +1,18 @@ + +#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..f4d9d18f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefResponse.g.cs @@ -0,0 +1,18 @@ + +#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..67fd910d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentBriefScheduledResponse.g.cs @@ -0,0 +1,18 @@ + +#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..073d4ed1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..799d3433 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentSubscriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..9aaa4b90 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaContentUnsubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..b973c1d8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaFeedItemsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..005a155f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewActionItemsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..c4c0ae6e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewApiMessagesResponse.g.cs @@ -0,0 +1,18 @@ + +#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..49475c9c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentApiMessagesResponse.g.cs @@ -0,0 +1,18 @@ + +#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..35dc664f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsResponse.g.cs @@ -0,0 +1,18 @@ + +#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.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.g.cs similarity index 84% rename from src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs rename to src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.g.cs index cbc6d9bf..ba115b9b 100644 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefJobsStatusResponse.g.cs @@ -6,7 +6,7 @@ namespace AI21 /// /// /// - public sealed partial class TlvConvragSolutionsTlvMunicipalityConvragPostResponse + public sealed partial class V1SolutionsVidaaPreviewContentBriefJobsStatusResponse { /// 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..9be95444 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefResponse.g.cs @@ -0,0 +1,18 @@ + +#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..890c0057 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentBriefScheduledResponse.g.cs @@ -0,0 +1,18 @@ + +#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..155922f9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..e1e3de57 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentSubscriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..c78ea212 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewContentUnsubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..a36359cb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewFeedItemsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..d7574b4d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSchedulerStatsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..2e930cfd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSourcesResponse.g.cs @@ -0,0 +1,18 @@ + +#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..eebd2228 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..9c1096ed --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSubscriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..737c6063 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewSummarizeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..985c7b92 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewTriggerPollResponse.g.cs @@ -0,0 +1,18 @@ + +#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..0f330b6b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaPreviewUnsubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..9216f835 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSchedulerStatsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..f2d12417 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSourcesResponse.g.cs @@ -0,0 +1,18 @@ + +#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..09284dba --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..a0b0614c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSubscriptionsResponse.g.cs @@ -0,0 +1,18 @@ + +#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..470ceb14 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaSummarizeResponse.g.cs @@ -0,0 +1,18 @@ + +#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..36712217 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaTriggerPollResponse.g.cs @@ -0,0 +1,18 @@ + +#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..cb355dc8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsVidaaUnsubscribeResponse.g.cs @@ -0,0 +1,18 @@ + +#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.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.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..df5c9f7e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.OptionsSupport.g.cs @@ -0,0 +1,462 @@ + +#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; + } + } + + /// + /// 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; } + } + + /// + /// 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. + /// + public global::System.TimeSpan? Delay { get; set; } + } + + + /// + /// 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 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.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, + 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 async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + global::System.Threading.CancellationToken cancellationToken) + { + var delay = requestOptions?.Retry?.Delay ?? + clientOptions.Retry?.Delay; + if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + { + return; + } + + await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + } + + 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..a0af5d25 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,309 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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(); + + return + global::AI21.IngestionBatchStatusResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).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 + __effectiveCancellationToken + #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), + }; + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.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..40f5136c 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,12 @@ 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) { PrepareArguments( @@ -62,22 +65,43 @@ 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 +111,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..9ae12e0c 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,12 @@ 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) { PrepareArguments( @@ -63,22 +66,43 @@ 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 +112,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..e3985819 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +440,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 +455,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 +475,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..df8c27c2 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,37 @@ 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. + /// 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 = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + global::AI21.AutoSDKClientOptions? options = null, 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..f011baab 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,11 @@ 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) { PrepareArguments( @@ -57,22 +60,43 @@ 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 +106,266 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..61560878 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,324 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +442,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..9d5f264f 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,12 @@ 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) { PrepareArguments( @@ -62,25 +65,46 @@ 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 +114,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..c63f390e 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,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, 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 +73,43 @@ 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 +119,312 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +432,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 +451,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..7c792f53 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,37 @@ 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. + /// 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 = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + global::AI21.AutoSDKClientOptions? options = null, 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..56ec0e35 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +433,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 +443,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 +458,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..cf0b0ffb 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,12 @@ 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) { PrepareArguments( @@ -62,25 +65,46 @@ 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 +114,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..9e7a865c 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,12 @@ 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) { PrepareArguments( @@ -62,25 +65,46 @@ 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 +114,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..36cb8b48 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,12 @@ 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) { PrepareArguments( @@ -62,25 +65,46 @@ 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 +114,305 @@ 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, + 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 __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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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..95fa15ad 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,322 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +439,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..4706034b 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,311 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +426,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 +445,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..1a7a3527 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,13 @@ 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) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +68,43 @@ 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 +114,322 @@ 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, + 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 __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, + 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( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + 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, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + 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, + 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, + 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 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 (__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 __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 + __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 new global::AI21.ApiException( + message: __content ?? __response.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::AI21.ApiException( - message: __content ?? __response.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 +439,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..4295906e 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,37 @@ 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. + /// 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 = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + global::AI21.AutoSDKClientOptions? options = null, 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..6a0cef8c 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/deep-research/runs":{"post":{"summary":"Create Deep Research Run","operationId":"v1_deep_research_run","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDeepResearchPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepResearchRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/deep-research/entitlement":{"get":{"summary":"Get Deep Research Entitlement","operationId":"v1_get_deep_research_entitlement","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepResearchEntitlement"}}}}}}},"/studio/v1/deep-research/status":{"get":{"summary":"Get Deep Research Status","operationId":"v1_get_deep_research_status","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepResearchEnabled"}}}}}}},"/studio/v1/deep-research/runs/{execution_id}":{"get":{"summary":"Get Deep Research Run","description":"Return the current run state, or SSE-stream if ``stream=true``.\n\nStreaming lets clients reconnect to an in-progress run after a network\ndrop without creating a duplicate execution. The stream replays the\nexecution tracer from the current cursor and terminates with a ``result``\nevent once the run settles (or the run is already terminal).\n\nClients that want to resume from a specific position in the event stream\nshould send the standard SSE ``Last-Event-ID`` header; the tracer will\nreplay only events after that id (see systems-execution-tracer\n``events-stream`` endpoint).","operationId":"v1_get_deep_research_run","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Stream","default":false},"name":"stream","in":"query"},{"required":false,"schema":{"type":"string","title":"Last-Event-Id"},"name":"Last-Event-ID","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepResearchRunResult"}}}},"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"},"CitationItem":{"properties":{"ref":{"type":"integer","title":"Ref"},"url":{"type":"string","title":"Url"},"title":{"type":"string","title":"Title"},"snippet":{"type":"string","title":"Snippet"}},"type":"object","required":["ref","url"],"title":"CitationItem"},"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"},"CreateDeepResearchPayload":{"properties":{"prompt":{"type":"string","maxLength":10000,"minLength":1,"title":"Prompt"},"budget_cost":{"type":"number","maximum":10.0,"exclusiveMinimum":0.0,"title":"Budget Cost"},"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":["prompt","budget_cost"],"title":"CreateDeepResearchPayload"},"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"},"DeepResearchCandidate":{"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"},"cost_usd":{"type":"number","title":"Cost Usd"},"score":{"type":"number","title":"Score"},"report_md":{"type":"string","title":"Report Md"}},"type":"object","required":["id","cost_usd","score"],"title":"DeepResearchCandidate"},"DeepResearchEnabled":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"DeepResearchEnabled"},"DeepResearchEntitlement":{"properties":{"usage_limit":{"type":"integer","title":"Usage Limit"},"current_usage":{"type":"integer","title":"Current Usage"},"remaining":{"type":"integer","title":"Remaining"},"unlimited":{"type":"boolean","title":"Unlimited"}},"type":"object","required":["usage_limit","current_usage","remaining","unlimited"],"title":"DeepResearchEntitlement"},"DeepResearchError":{"properties":{"message":{"type":"string","title":"Message"},"type":{"type":"string","title":"Type"}},"type":"object","required":["message"],"title":"DeepResearchError"},"DeepResearchResult":{"properties":{"report_md":{"type":"string","title":"Report Md"},"candidates":{"items":{"$ref":"#/components/schemas/DeepResearchCandidate"},"type":"array","title":"Candidates","default":[]},"rubrics_summary":{"$ref":"#/components/schemas/RubricsSummary"},"citations":{"items":{"$ref":"#/components/schemas/CitationItem"},"type":"array","title":"Citations","default":[]},"execution_viewer_url":{"type":"string","title":"Execution Viewer Url"},"budget_exhausted":{"type":"boolean","title":"Budget Exhausted","default":false},"budget_exceeded_reasons":{"items":{"type":"string"},"type":"array","title":"Budget Exceeded Reasons","default":[]}},"type":"object","required":["report_md"],"title":"DeepResearchResult"},"DeepResearchRunResult":{"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":["queued","in_progress","completed","failed","budget_exhausted"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"result":{"$ref":"#/components/schemas/DeepResearchResult"},"error":{"$ref":"#/components/schemas/DeepResearchError"}},"type":"object","required":["id","status"],"title":"DeepResearchRunResult"},"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."},"RubricsSummary":{"properties":{"comprehensiveness":{"type":"number","title":"Comprehensiveness"},"depth":{"type":"number","title":"Depth"},"instruction_following":{"type":"number","title":"Instruction Following"},"readability":{"type":"number","title":"Readability"}},"type":"object","title":"RubricsSummary"},"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