Skip to content

Commit

Permalink
Merge pull request #40 from tryAGI/bot/update-openapi_202410010631
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 1, 2024
2 parents db68ea3 + 00cb7f8 commit d98fbe5
Show file tree
Hide file tree
Showing 63 changed files with 776 additions and 344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});
}
}
}
4 changes: 2 additions & 2 deletions src/libs/AI21/Generated/AI21.Ai21Api.Constructors.Bearer.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace AI21
{
public sealed partial class Ai21Api
{
/// <inheritdoc cref="Ai21Api(global::System.Net.Http.HttpClient?, global::System.Uri?, global::AI21.EndPointAuthorization?)"/>
/// <inheritdoc cref="Ai21Api(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::AI21.EndPointAuthorization}?)"/>
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<global::AI21.EndPointAuthorization>? authorizations = null) : this(httpClient, baseUri, authorizations)
{
Authorizing(_httpClient, ref apiKey);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))}]"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 15 additions & 6 deletions src/libs/AI21/Generated/AI21.Ai21Api.V1Answer.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 15 additions & 6 deletions src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 15 additions & 6 deletions src/libs/AI21/Generated/AI21.Ai21Api.V1Embed.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
32 changes: 16 additions & 16 deletions src/libs/AI21/Generated/AI21.Ai21Api.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<global::AI21.EndPointAuthorization> _authorizations;

/// <summary>
///
Expand All @@ -27,95 +27,95 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis
/// <summary>
///
/// </summary>
public JambaCompleteClient JambaComplete => new JambaCompleteClient(_httpClient, authorization: _authorization)
public JambaCompleteClient JambaComplete => new JambaCompleteClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public CompletionClient Completion => new CompletionClient(_httpClient, authorization: _authorization)
public CompletionClient Completion => new CompletionClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public CustomModelsClient CustomModels => new CustomModelsClient(_httpClient, authorization: _authorization)
public CustomModelsClient CustomModels => new CustomModelsClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public DatasetsClient Datasets => new DatasetsClient(_httpClient, authorization: _authorization)
public DatasetsClient Datasets => new DatasetsClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public ParaphraseClient Paraphrase => new ParaphraseClient(_httpClient, authorization: _authorization)
public ParaphraseClient Paraphrase => new ParaphraseClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public SummarizeClient Summarize => new SummarizeClient(_httpClient, authorization: _authorization)
public SummarizeClient Summarize => new SummarizeClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public SegmentationClient Segmentation => new SegmentationClient(_httpClient, authorization: _authorization)
public SegmentationClient Segmentation => new SegmentationClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public GrammaticalErrorCorrectionsClient GrammaticalErrorCorrections => new GrammaticalErrorCorrectionsClient(_httpClient, authorization: _authorization)
public GrammaticalErrorCorrectionsClient GrammaticalErrorCorrections => new GrammaticalErrorCorrectionsClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public LibraryManagementClient LibraryManagement => new LibraryManagementClient(_httpClient, authorization: _authorization)
public LibraryManagementClient LibraryManagement => new LibraryManagementClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public RAGEngineClient RAGEngine => new RAGEngineClient(_httpClient, authorization: _authorization)
public RAGEngineClient RAGEngine => new RAGEngineClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public ChatClient Chat => new ChatClient(_httpClient, authorization: _authorization)
public ChatClient Chat => new ChatClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public TokenizeClient Tokenize => new TokenizeClient(_httpClient, authorization: _authorization)
public TokenizeClient Tokenize => new TokenizeClient(_httpClient, authorizations: _authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};
Expand All @@ -127,15 +127,15 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public Ai21Api(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::AI21.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::AI21.EndPointAuthorization>? 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<global::AI21.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
21 changes: 15 additions & 6 deletions src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/libs/AI21/Generated/AI21.ChatClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<global::AI21.EndPointAuthorization> _authorizations;

/// <summary>
///
Expand All @@ -30,15 +30,15 @@ public sealed partial class ChatClient : global::AI21.IChatClient, global::Syste
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
/// <param name="authorizations"></param>
public ChatClient(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::AI21.EndPointAuthorization? authorization = null)
global::System.Collections.Generic.List<global::AI21.EndPointAuthorization>? 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<global::AI21.EndPointAuthorization>();

Initialized(_httpClient);
}
Expand Down
Loading

0 comments on commit d98fbe5

Please sign in to comment.