From 00cb7f81bc47ab46ad49c74caaf75128173d5951 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 1 Oct 2024 06:31:25 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../AI21.Ai21Api.Authorizations.Bearer.g.cs | 7 ++-- .../AI21.Ai21Api.Constructors.Bearer.g.cs | 4 +-- ...umentFileStudioV1ChatFilesConvertPost.g.cs | 21 ++++++++---- ...orsConnectedUsersUserIdDataSourcesGet.g.cs | 21 ++++++++---- ...nectorsConnectedUsersUserIdTokensPost.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.Ai21Api.V1Answer.g.cs | 21 ++++++++---- .../AI21.Ai21Api.V1ConversationalRag.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.Ai21Api.V1Embed.g.cs | 21 ++++++++---- src/libs/AI21/Generated/AI21.Ai21Api.g.cs | 32 +++++++++---------- .../AI21.ChatClient.V1J2UltraChat.g.cs | 21 ++++++++---- src/libs/AI21/Generated/AI21.ChatClient.g.cs | 8 ++--- ...1.CompletionClient.V1J2GrandeComplete.g.cs | 21 ++++++++---- ...nClient.V1J2GrandeCustomModelComplete.g.cs | 21 ++++++++---- ...tionClient.V1J2GrandeInstructComplete.g.cs | 21 ++++++++---- ...21.CompletionClient.V1J2JumboComplete.g.cs | 21 ++++++++---- ...1.CompletionClient.V1J2JumboComplete2.g.cs | 21 ++++++++---- ...etionClient.V1J2JumboInstructComplete.g.cs | 21 ++++++++---- ...21.CompletionClient.V1J2LargeComplete.g.cs | 21 ++++++++---- ...onClient.V1J2LargeCustomModelComplete.g.cs | 21 ++++++++---- ...etionClient.V1J2LargeInstructComplete.g.cs | 21 ++++++++---- ...21.CompletionClient.V1J2LightComplete.g.cs | 21 ++++++++---- ...onClient.V1J2LightCustomModelComplete.g.cs | 21 ++++++++---- ...AI21.CompletionClient.V1J2MidComplete.g.cs | 21 ++++++++---- ...tionClient.V1J2MidCustomModelComplete.g.cs | 21 ++++++++---- ...21.CompletionClient.V1J2UltraComplete.g.cs | 21 ++++++++---- ...1.CompletionClient.V1J2UltraComplete2.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.CompletionClient.g.cs | 8 ++--- ...ustomModelsClient.V1CreateCustomModel.g.cs | 21 ++++++++---- ...1.CustomModelsClient.V1GetCustomModel.g.cs | 21 ++++++++---- ....CustomModelsClient.V1GetCustomModels.g.cs | 21 ++++++++---- ...ustomModelsClient.V1UpdateCustomModel.g.cs | 21 ++++++++---- .../Generated/AI21.CustomModelsClient.g.cs | 8 ++--- .../AI21.DatasetsClient.V1DeleteDataset.g.cs | 21 ++++++++---- .../AI21.DatasetsClient.V1GetDataset.g.cs | 21 ++++++++---- ...atasetsClient.V1GetDatasetDownloadUrl.g.cs | 21 ++++++++---- .../AI21.DatasetsClient.V1GetDatasets.g.cs | 21 ++++++++---- .../AI21.DatasetsClient.V1UploadDataset.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.DatasetsClient.g.cs | 8 ++--- ...lErrorCorrectionsClient.V1Corrections.g.cs | 21 ++++++++---- ...I21.GrammaticalErrorCorrectionsClient.g.cs | 8 ++--- ...21.JambaCompleteClient.V1ChatComplete.g.cs | 21 ++++++++---- .../Generated/AI21.JambaCompleteClient.g.cs | 8 ++--- ...braryManagementClient.V1LibraryDelete.g.cs | 21 ++++++++---- ...yManagementClient.V1LibraryManagement.g.cs | 21 ++++++++---- ...ManagementClient.V1LibraryManagement2.g.cs | 21 ++++++++---- ...ManagementClient.V1LibraryManagement3.g.cs | 21 ++++++++---- ...braryManagementClient.V1LibraryUpload.g.cs | 21 ++++++++---- .../AI21.LibraryManagementClient.g.cs | 8 ++--- .../AI21.ParaphraseClient.V1Paraphraze.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.ParaphraseClient.g.cs | 8 ++--- src/libs/AI21/Generated/AI21.PathBuilder.g.cs | 10 ++++++ .../AI21.RAGEngineClient.V1LibraryAnswer.g.cs | 21 ++++++++---- ...1.RAGEngineClient.V1LibraryManagement.g.cs | 21 ++++++++---- .../AI21.RAGEngineClient.V1LibrarySearch.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.RAGEngineClient.g.cs | 8 ++--- ...I21.SegmentationClient.V1Segmentation.g.cs | 21 ++++++++---- .../Generated/AI21.SegmentationClient.g.cs | 8 ++--- .../AI21.SummarizeClient.V1Summarize.g.cs | 21 ++++++++---- ....SummarizeClient.V1SummarizeBySegment.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.SummarizeClient.g.cs | 8 ++--- .../AI21.TokenizeClient.V1Tokenize.g.cs | 21 ++++++++---- .../AI21/Generated/AI21.TokenizeClient.g.cs | 8 ++--- .../Generated/JsonSerializerContextTypes.g.cs | 5 +++ 63 files changed, 776 insertions(+), 344 deletions(-) diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.Authorizations.Bearer.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.Authorizations.Bearer.g.cs index 966a210..d4d4bed 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.Authorizations.Bearer.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.Authorizations.Bearer.g.cs @@ -14,11 +14,14 @@ public void AuthorizeUsingBearer( { apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - _authorization = new global::AI21.EndPointAuthorization + _authorizations.Clear(); + _authorizations.Add(new global::AI21.EndPointAuthorization { + Type = "Http", + Location = "Header", Name = "Bearer", Value = apiKey, - }; + }); } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.Constructors.Bearer.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.Constructors.Bearer.g.cs index 3035a63..db1da26 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.Constructors.Bearer.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.Constructors.Bearer.g.cs @@ -5,12 +5,12 @@ namespace AI21 { public sealed partial class Ai21Api { - /// + /// public Ai21Api( string apiKey, global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) : this(httpClient, baseUri, authorization) + global::System.Collections.Generic.List? authorizations = null) : this(httpClient, baseUri, authorizations) { Authorizing(_httpClient, ref apiKey); diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 212c2ac..9e36f4c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -47,12 +47,21 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Files, x => x))}]"), diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.GetUserDataSourcesInfoStudioV1ConnectorsConnectedUsersUserIdDataSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.GetUserDataSourcesInfoStudioV1ConnectorsConnectedUsersUserIdDataSourcesGet.g.cs index e4c9725..7bf45a8 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.GetUserDataSourcesInfoStudioV1ConnectorsConnectedUsersUserIdDataSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.GetUserDataSourcesInfoStudioV1ConnectorsConnectedUsersUserIdDataSourcesGet.g.cs @@ -45,12 +45,21 @@ partial void ProcessGetUserDataSourcesInfoStudioV1ConnectorsConnectedUsersUserId method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.GetUserTokenStudioV1ConnectorsConnectedUsersUserIdTokensPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.GetUserTokenStudioV1ConnectorsConnectedUsersUserIdTokensPost.g.cs index c350bea..b6d0ece 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.GetUserTokenStudioV1ConnectorsConnectedUsersUserIdTokensPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.GetUserTokenStudioV1ConnectorsConnectedUsersUserIdTokensPost.g.cs @@ -45,12 +45,21 @@ partial void ProcessGetUserTokenStudioV1ConnectorsConnectedUsersUserIdTokensPost method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.V1Answer.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.V1Answer.g.cs index 35707b9..4ec98bb 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.V1Answer.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.V1Answer.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1AnswerResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs index ce14747..566a739 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1ConversationalRagResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.V1Embed.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.V1Embed.g.cs index 5ae2ad3..d936f05 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.V1Embed.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.V1Embed.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1EmbedResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.g.cs index 27e1e45..0145a2c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.g.cs @@ -16,7 +16,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -27,7 +27,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public JambaCompleteClient JambaComplete => new JambaCompleteClient(_httpClient, authorization: _authorization) + public JambaCompleteClient JambaComplete => new JambaCompleteClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -35,7 +35,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public CompletionClient Completion => new CompletionClient(_httpClient, authorization: _authorization) + public CompletionClient Completion => new CompletionClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -43,7 +43,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public CustomModelsClient CustomModels => new CustomModelsClient(_httpClient, authorization: _authorization) + public CustomModelsClient CustomModels => new CustomModelsClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -51,7 +51,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public DatasetsClient Datasets => new DatasetsClient(_httpClient, authorization: _authorization) + public DatasetsClient Datasets => new DatasetsClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -59,7 +59,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public ParaphraseClient Paraphrase => new ParaphraseClient(_httpClient, authorization: _authorization) + public ParaphraseClient Paraphrase => new ParaphraseClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -67,7 +67,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public SummarizeClient Summarize => new SummarizeClient(_httpClient, authorization: _authorization) + public SummarizeClient Summarize => new SummarizeClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -75,7 +75,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public SegmentationClient Segmentation => new SegmentationClient(_httpClient, authorization: _authorization) + public SegmentationClient Segmentation => new SegmentationClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -83,7 +83,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public GrammaticalErrorCorrectionsClient GrammaticalErrorCorrections => new GrammaticalErrorCorrectionsClient(_httpClient, authorization: _authorization) + public GrammaticalErrorCorrectionsClient GrammaticalErrorCorrections => new GrammaticalErrorCorrectionsClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -91,7 +91,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public LibraryManagementClient LibraryManagement => new LibraryManagementClient(_httpClient, authorization: _authorization) + public LibraryManagementClient LibraryManagement => new LibraryManagementClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -99,7 +99,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public RAGEngineClient RAGEngine => new RAGEngineClient(_httpClient, authorization: _authorization) + public RAGEngineClient RAGEngine => new RAGEngineClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -107,7 +107,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public ChatClient Chat => new ChatClient(_httpClient, authorization: _authorization) + public ChatClient Chat => new ChatClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -115,7 +115,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - public TokenizeClient Tokenize => new TokenizeClient(_httpClient, authorization: _authorization) + public TokenizeClient Tokenize => new TokenizeClient(_httpClient, authorizations: _authorizations) { JsonSerializerContext = JsonSerializerContext, }; @@ -127,15 +127,15 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// /// /// - /// + /// public Ai21Api( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs b/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs index a1e0c41..41172bd 100644 --- a/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs +++ b/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2UltraChatResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.ChatClient.g.cs b/src/libs/AI21/Generated/AI21.ChatClient.g.cs index 3d1c359..cbf8a13 100644 --- a/src/libs/AI21/Generated/AI21.ChatClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ChatClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class ChatClient : global::AI21.IChatClient, global::Syste public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class ChatClient : global::AI21.IChatClient, global::Syste /// /// /// - /// + /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs index a494c46..d50e812 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2GrandeCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs index 2e751bb..a003476 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs @@ -62,12 +62,21 @@ partial void ProcessV1J2GrandeCustomModelCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs index 1fb8e49..312b4b1 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2GrandeInstructCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs index e90bd30..6d71004 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2JumboCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs index e50f30f..933f0f6 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs @@ -62,12 +62,21 @@ partial void ProcessV1J2JumboComplete2ResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs index 671eabe..b122fad 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2JumboInstructCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs index 4f7443d..41f7aaf 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2LargeCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs index 88c996f..d4cb279 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs @@ -62,12 +62,21 @@ partial void ProcessV1J2LargeCustomModelCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs index daee7ae..9fe0672 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2LargeInstructCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs index 6c81237..ad77f04 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2LightCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs index f8c7d06..34c9646 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs @@ -62,12 +62,21 @@ partial void ProcessV1J2LightCustomModelCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs index 91ccd03..7118276 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2MidCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs index 04a471e..6c6c363 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs @@ -62,12 +62,21 @@ partial void ProcessV1J2MidCustomModelCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs index ac1bb84..d00c017 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1J2UltraCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs index 292b311..e7925c6 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs @@ -62,12 +62,21 @@ partial void ProcessV1J2UltraComplete2ResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.g.cs index 9d452ed..adae820 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class CompletionClient : global::AI21.ICompletionClient, g public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class CompletionClient : global::AI21.ICompletionClient, g /// /// /// - /// + /// public CompletionClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs index e386c63..ada8934 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1CreateCustomModelResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs index 858daf9..83e6250 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs @@ -45,12 +45,21 @@ partial void ProcessV1GetCustomModelResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs index 864d88f..3f9fa51 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs @@ -50,12 +50,21 @@ partial void ProcessV1GetCustomModelsResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs index a2f96d0..669e0d5 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs @@ -52,12 +52,21 @@ partial void ProcessV1UpdateCustomModelResponseContent( method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs index 7095568..bb0f8c3 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class CustomModelsClient : global::AI21.ICustomModelsClien public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class CustomModelsClient : global::AI21.ICustomModelsClien /// /// /// - /// + /// public CustomModelsClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.DatasetsClient.V1DeleteDataset.g.cs b/src/libs/AI21/Generated/AI21.DatasetsClient.V1DeleteDataset.g.cs index adc9dab..493bd2a 100644 --- a/src/libs/AI21/Generated/AI21.DatasetsClient.V1DeleteDataset.g.cs +++ b/src/libs/AI21/Generated/AI21.DatasetsClient.V1DeleteDataset.g.cs @@ -45,12 +45,21 @@ partial void ProcessV1DeleteDatasetResponseContent( method: global::System.Net.Http.HttpMethod.Delete, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDataset.g.cs b/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDataset.g.cs index 7e185a4..0bc24cb 100644 --- a/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDataset.g.cs +++ b/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDataset.g.cs @@ -45,12 +45,21 @@ partial void ProcessV1GetDatasetResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasetDownloadUrl.g.cs b/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasetDownloadUrl.g.cs index b261877..07dd7c2 100644 --- a/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasetDownloadUrl.g.cs +++ b/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasetDownloadUrl.g.cs @@ -53,12 +53,21 @@ partial void ProcessV1GetDatasetDownloadUrlResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasets.g.cs b/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasets.g.cs index d7ea66b..3c3864b 100644 --- a/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasets.g.cs +++ b/src/libs/AI21/Generated/AI21.DatasetsClient.V1GetDatasets.g.cs @@ -40,12 +40,21 @@ partial void ProcessV1GetDatasetsResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.DatasetsClient.V1UploadDataset.g.cs b/src/libs/AI21/Generated/AI21.DatasetsClient.V1UploadDataset.g.cs index 8a327dc..7a5e440 100644 --- a/src/libs/AI21/Generated/AI21.DatasetsClient.V1UploadDataset.g.cs +++ b/src/libs/AI21/Generated/AI21.DatasetsClient.V1UploadDataset.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1UploadDatasetResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.ByteArrayContent(request.DatasetFile ?? global::System.Array.Empty()) diff --git a/src/libs/AI21/Generated/AI21.DatasetsClient.g.cs b/src/libs/AI21/Generated/AI21.DatasetsClient.g.cs index f4d1450..bc86bbb 100644 --- a/src/libs/AI21/Generated/AI21.DatasetsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.DatasetsClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class DatasetsClient : global::AI21.IDatasetsClient, globa public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class DatasetsClient : global::AI21.IDatasetsClient, globa /// /// /// - /// + /// public DatasetsClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.V1Corrections.g.cs b/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.V1Corrections.g.cs index 74507e7..612e8cf 100644 --- a/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.V1Corrections.g.cs +++ b/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.V1Corrections.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1CorrectionsResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.g.cs b/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.g.cs index 01a705c..00ae8b2 100644 --- a/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.GrammaticalErrorCorrectionsClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class GrammaticalErrorCorrectionsClient : global::AI21.IGr public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class GrammaticalErrorCorrectionsClient : global::AI21.IGr /// /// /// - /// + /// public GrammaticalErrorCorrectionsClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs index 7788829..af66121 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs @@ -57,12 +57,21 @@ partial void ProcessV1ChatCompleteResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } httpRequest.Headers.TryAddWithoutValidation("Authorization", authorization.ToString()); diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs index cd889cb..b09f055 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class JambaCompleteClient : global::AI21.IJambaCompleteCli public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class JambaCompleteClient : global::AI21.IJambaCompleteCli /// /// /// - /// + /// public JambaCompleteClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs index d2c1ecb..113926a 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs @@ -48,12 +48,21 @@ partial void ProcessV1LibraryDeleteResponseContent( method: global::System.Net.Http.HttpMethod.Delete, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs index 55848f1..ee044fa 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs @@ -84,12 +84,21 @@ partial void ProcessV1LibraryManagementResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs index 8ed0cf5..178a70c 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs @@ -53,12 +53,21 @@ partial void ProcessV1LibraryManagement2ResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs index d55827e..37a039c 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs @@ -60,12 +60,21 @@ partial void ProcessV1LibraryManagement3ResponseContent( method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs index d5a4990..97a62f6 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs @@ -53,12 +53,21 @@ partial void ProcessV1LibraryUploadResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()) diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs index 39424ac..0daa08c 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class LibraryManagementClient : global::AI21.ILibraryManag public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class LibraryManagementClient : global::AI21.ILibraryManag /// /// /// - /// + /// public LibraryManagementClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs b/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs index b84cf25..79fcb0a 100644 --- a/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs +++ b/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1ParaphrazeResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs b/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs index 1225926..90049e7 100644 --- a/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class ParaphraseClient : global::AI21.IParaphraseClient, g public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class ParaphraseClient : global::AI21.IParaphraseClient, g /// /// /// - /// + /// public ParaphraseClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.PathBuilder.g.cs b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs index ce3523e..2575afe 100644 --- a/src/libs/AI21/Generated/AI21.PathBuilder.g.cs +++ b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs @@ -230,6 +230,16 @@ public PathBuilder AddOptionalParameter( /// public class EndPointAuthorization { + /// + /// + /// + public string Type { get; set; } = string.Empty; + + /// + /// + /// + public string Location { get; set; } = string.Empty; + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs index 427d256..8e6fba8 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1LibraryAnswerResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs index fcdaa31..f075923 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs @@ -45,12 +45,21 @@ partial void ProcessV1LibraryManagementResponseContent( method: global::System.Net.Http.HttpMethod.Get, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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, diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs index dddea02..86b5dc5 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1LibrarySearchResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs index f2fbd95..a9a7c43 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class RAGEngineClient : global::AI21.IRAGEngineClient, glo public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class RAGEngineClient : global::AI21.IRAGEngineClient, glo /// /// /// - /// + /// public RAGEngineClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs b/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs index 5c2c3a3..6b9e49c 100644 --- a/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs +++ b/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1SegmentationResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs b/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs index a9b6746..01edf9a 100644 --- a/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs +++ b/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class SegmentationClient : global::AI21.ISegmentationClien public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class SegmentationClient : global::AI21.ISegmentationClien /// /// /// - /// + /// public SegmentationClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs b/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs index 6e9205b..330d613 100644 --- a/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs +++ b/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1SummarizeResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs b/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs index 435b471..4f77d18 100644 --- a/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs +++ b/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1SummarizeBySegmentResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs b/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs index d7b327c..343ee14 100644 --- a/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs +++ b/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class SummarizeClient : global::AI21.ISummarizeClient, glo public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class SummarizeClient : global::AI21.ISummarizeClient, glo /// /// /// - /// + /// public SummarizeClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/AI21.TokenizeClient.V1Tokenize.g.cs b/src/libs/AI21/Generated/AI21.TokenizeClient.V1Tokenize.g.cs index 836d866..307ffc5 100644 --- a/src/libs/AI21/Generated/AI21.TokenizeClient.V1Tokenize.g.cs +++ b/src/libs/AI21/Generated/AI21.TokenizeClient.V1Tokenize.g.cs @@ -47,12 +47,21 @@ partial void ProcessV1TokenizeResponseContent( method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); - if (_authorization != null) - {{ - httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: _authorization.Name, - parameter: _authorization.Value); - }} + 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); + } + } var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, diff --git a/src/libs/AI21/Generated/AI21.TokenizeClient.g.cs b/src/libs/AI21/Generated/AI21.TokenizeClient.g.cs index f2df3d4..fb4a0fd 100644 --- a/src/libs/AI21/Generated/AI21.TokenizeClient.g.cs +++ b/src/libs/AI21/Generated/AI21.TokenizeClient.g.cs @@ -15,7 +15,7 @@ public sealed partial class TokenizeClient : global::AI21.ITokenizeClient, globa public const string BaseUrl = "https://api.ai21.com/"; private readonly global::System.Net.Http.HttpClient _httpClient; - private global::AI21.EndPointAuthorization? _authorization; + private global::System.Collections.Generic.List _authorizations; /// /// @@ -30,15 +30,15 @@ public sealed partial class TokenizeClient : global::AI21.ITokenizeClient, globa /// /// /// - /// + /// public TokenizeClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, - global::AI21.EndPointAuthorization? authorization = null) + global::System.Collections.Generic.List? authorizations = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); - _authorization = authorization; + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); Initialized(_httpClient); } diff --git a/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs b/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs index 813d6d0..b1b04f0 100644 --- a/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs +++ b/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs @@ -10,6 +10,11 @@ namespace AI21 /// public sealed partial class JsonSerializerContextTypes { + /// + /// + /// + public global::System.Collections.Generic.Dictionary? StringStringDictionary { get; set; } + /// /// ///