Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Add optional xiApiKey parameter and update OpenAPI specification in DeepInfraApi #52

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ public partial class DeepInfraApi
{
partial void PrepareCreateVoiceV1VoicesAddPostArguments(
global::System.Net.Http.HttpClient httpClient,
ref string? xiApiKey,
global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request);
partial void PrepareCreateVoiceV1VoicesAddPostRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string? xiApiKey,
global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request);
partial void ProcessCreateVoiceV1VoicesAddPostResponse(
global::System.Net.Http.HttpClient httpClient,
Expand All @@ -26,11 +28,13 @@ partial void ProcessCreateVoiceV1VoicesAddPostResponseContent(
/// Create Voice<br/>
/// Create a new voice
/// </summary>
/// <param name="xiApiKey"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::DeepInfra.Voice2> CreateVoiceV1VoicesAddPostAsync(
global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand All @@ -39,12 +43,19 @@ partial void ProcessCreateVoiceV1VoicesAddPostResponseContent(
client: _httpClient);
PrepareCreateVoiceV1VoicesAddPostArguments(
httpClient: _httpClient,
xiApiKey: ref xiApiKey,
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/voices/add", global::System.UriKind.RelativeOrAbsolute));
using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
if (xiApiKey != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{xiApiKey}"),
name: "xi-api-Key");
}
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Name}"),
name: "name");
Expand All @@ -62,6 +73,7 @@ partial void ProcessCreateVoiceV1VoicesAddPostResponseContent(
PrepareCreateVoiceV1VoicesAddPostRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
xiApiKey: xiApiKey,
request: request);

using var response = await _httpClient.SendAsync(
Expand Down Expand Up @@ -105,6 +117,7 @@ partial void ProcessCreateVoiceV1VoicesAddPostResponseContent(
/// Create Voice<br/>
/// Create a new voice
/// </summary>
/// <param name="xiApiKey"></param>
/// <param name="name"></param>
/// <param name="description"></param>
/// <param name="files"></param>
Expand All @@ -114,6 +127,7 @@ partial void ProcessCreateVoiceV1VoicesAddPostResponseContent(
string name,
string description,
global::System.Collections.Generic.IList<byte[]> files,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new global::DeepInfra.BodyCreateVoiceV1VoicesAddPost
Expand All @@ -124,6 +138,7 @@ partial void ProcessCreateVoiceV1VoicesAddPostResponseContent(
};

return await CreateVoiceV1VoicesAddPostAsync(
xiApiKey: xiApiKey,
request: request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ public partial class DeepInfraApi
{
partial void PrepareDeleteVoiceV1VoicesVoiceIdDeleteArguments(
global::System.Net.Http.HttpClient httpClient,
ref string voiceId);
ref string voiceId,
ref string? xiApiKey);
partial void PrepareDeleteVoiceV1VoicesVoiceIdDeleteRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string voiceId);
string voiceId,
string? xiApiKey);
partial void ProcessDeleteVoiceV1VoicesVoiceIdDeleteResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
Expand All @@ -25,17 +27,20 @@ partial void ProcessDeleteVoiceV1VoicesVoiceIdDeleteResponseContent(
/// Delete Voice
/// </summary>
/// <param name="voiceId"></param>
/// <param name="xiApiKey"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteResponse> DeleteVoiceV1VoicesVoiceIdDeleteAsync(
string voiceId,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareDeleteVoiceV1VoicesVoiceIdDeleteArguments(
httpClient: _httpClient,
voiceId: ref voiceId);
voiceId: ref voiceId,
xiApiKey: ref xiApiKey);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Delete,
Expand All @@ -47,7 +52,8 @@ partial void ProcessDeleteVoiceV1VoicesVoiceIdDeleteResponseContent(
PrepareDeleteVoiceV1VoicesVoiceIdDeleteRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
voiceId: voiceId);
voiceId: voiceId,
xiApiKey: xiApiKey);

using var response = await _httpClient.SendAsync(
request: httpRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ public partial class DeepInfraApi
{
partial void PrepareGetVoiceV1VoicesVoiceIdGetArguments(
global::System.Net.Http.HttpClient httpClient,
ref string voiceId);
ref string voiceId,
ref string? xiApiKey);
partial void PrepareGetVoiceV1VoicesVoiceIdGetRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string voiceId);
string voiceId,
string? xiApiKey);
partial void ProcessGetVoiceV1VoicesVoiceIdGetResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
Expand All @@ -26,17 +28,20 @@ partial void ProcessGetVoiceV1VoicesVoiceIdGetResponseContent(
/// Get a voice by its id
/// </summary>
/// <param name="voiceId"></param>
/// <param name="xiApiKey"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::DeepInfra.Voice2> GetVoiceV1VoicesVoiceIdGetAsync(
string voiceId,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareGetVoiceV1VoicesVoiceIdGetArguments(
httpClient: _httpClient,
voiceId: ref voiceId);
voiceId: ref voiceId,
xiApiKey: ref xiApiKey);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
Expand All @@ -48,7 +53,8 @@ partial void ProcessGetVoiceV1VoicesVoiceIdGetResponseContent(
PrepareGetVoiceV1VoicesVoiceIdGetRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
voiceId: voiceId);
voiceId: voiceId,
xiApiKey: xiApiKey);

using var response = await _httpClient.SendAsync(
request: httpRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ namespace DeepInfra
public partial class DeepInfraApi
{
partial void PrepareGetVoicesV1VoicesGetArguments(
global::System.Net.Http.HttpClient httpClient);
global::System.Net.Http.HttpClient httpClient,
ref string? xiApiKey);
partial void PrepareGetVoicesV1VoicesGetRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage);
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string? xiApiKey);
partial void ProcessGetVoicesV1VoicesGetResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
Expand All @@ -23,15 +25,18 @@ partial void ProcessGetVoicesV1VoicesGetResponseContent(
/// Get Voices<br/>
/// Get available voices for a given user
/// </summary>
/// <param name="xiApiKey"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::DeepInfra.GetVoicesOut> GetVoicesV1VoicesGetAsync(
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareGetVoicesV1VoicesGetArguments(
httpClient: _httpClient);
httpClient: _httpClient,
xiApiKey: ref xiApiKey);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
Expand All @@ -42,7 +47,8 @@ partial void ProcessGetVoicesV1VoicesGetResponseContent(
request: httpRequest);
PrepareGetVoicesV1VoicesGetRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest);
httpRequestMessage: httpRequest,
xiApiKey: xiApiKey);

using var response = await _httpClient.SendAsync(
request: httpRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ partial void PrepareTextToSpeechV1TextToSpeechVoiceIdPostArguments(
global::System.Net.Http.HttpClient httpClient,
ref string voiceId,
ref string? xDeepinfraSource,
ref string? xiApiKey,
global::DeepInfra.ElevenLabsTextToSpeechIn request);
partial void PrepareTextToSpeechV1TextToSpeechVoiceIdPostRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string voiceId,
string? xDeepinfraSource,
string? xiApiKey,
global::DeepInfra.ElevenLabsTextToSpeechIn request);
partial void ProcessTextToSpeechV1TextToSpeechVoiceIdPostResponse(
global::System.Net.Http.HttpClient httpClient,
Expand All @@ -30,13 +32,15 @@ partial void ProcessTextToSpeechV1TextToSpeechVoiceIdPostResponseContent(
/// </summary>
/// <param name="voiceId"></param>
/// <param name="xDeepinfraSource"></param>
/// <param name="xiApiKey"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostResponse> TextToSpeechV1TextToSpeechVoiceIdPostAsync(
string voiceId,
global::DeepInfra.ElevenLabsTextToSpeechIn request,
string? xDeepinfraSource = default,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand All @@ -47,6 +51,7 @@ partial void ProcessTextToSpeechV1TextToSpeechVoiceIdPostResponseContent(
httpClient: _httpClient,
voiceId: ref voiceId,
xDeepinfraSource: ref xDeepinfraSource,
xiApiKey: ref xiApiKey,
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
Expand All @@ -67,6 +72,7 @@ partial void ProcessTextToSpeechV1TextToSpeechVoiceIdPostResponseContent(
httpRequestMessage: httpRequest,
voiceId: voiceId,
xDeepinfraSource: xDeepinfraSource,
xiApiKey: xiApiKey,
request: request);

using var response = await _httpClient.SendAsync(
Expand Down Expand Up @@ -111,6 +117,7 @@ partial void ProcessTextToSpeechV1TextToSpeechVoiceIdPostResponseContent(
/// </summary>
/// <param name="voiceId"></param>
/// <param name="xDeepinfraSource"></param>
/// <param name="xiApiKey"></param>
/// <param name="text">
/// Text to convert to speech<br/>
/// Example: I'm beginnin' to feel like a Rap God, Rap God<br/>
Expand All @@ -135,6 +142,7 @@ partial void ProcessTextToSpeechV1TextToSpeechVoiceIdPostResponseContent(
string voiceId,
string text,
string? xDeepinfraSource = default,
string? xiApiKey = default,
string? modelId = "deepinfra/tts",
global::System.AllOf<global::DeepInfra.TtsResponseFormat?>? outputFormat = default,
string? languageCode = default,
Expand All @@ -151,6 +159,7 @@ partial void ProcessTextToSpeechV1TextToSpeechVoiceIdPostResponseContent(
return await TextToSpeechV1TextToSpeechVoiceIdPostAsync(
voiceId: voiceId,
xDeepinfraSource: xDeepinfraSource,
xiApiKey: xiApiKey,
request: request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ public partial class DeepInfraApi
partial void PrepareUpdateVoiceV1VoicesVoiceIdEditPostArguments(
global::System.Net.Http.HttpClient httpClient,
ref string voiceId,
ref string? xiApiKey,
global::DeepInfra.UpdateVoiceIn request);
partial void PrepareUpdateVoiceV1VoicesVoiceIdEditPostRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string voiceId,
string? xiApiKey,
global::DeepInfra.UpdateVoiceIn request);
partial void ProcessUpdateVoiceV1VoicesVoiceIdEditPostResponse(
global::System.Net.Http.HttpClient httpClient,
Expand All @@ -27,12 +29,14 @@ partial void ProcessUpdateVoiceV1VoicesVoiceIdEditPostResponseContent(
/// Update Voice
/// </summary>
/// <param name="voiceId"></param>
/// <param name="xiApiKey"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::DeepInfra.Voice2> UpdateVoiceV1VoicesVoiceIdEditPostAsync(
string voiceId,
global::DeepInfra.UpdateVoiceIn request,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand All @@ -42,6 +46,7 @@ partial void ProcessUpdateVoiceV1VoicesVoiceIdEditPostResponseContent(
PrepareUpdateVoiceV1VoicesVoiceIdEditPostArguments(
httpClient: _httpClient,
voiceId: ref voiceId,
xiApiKey: ref xiApiKey,
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
Expand All @@ -61,6 +66,7 @@ partial void ProcessUpdateVoiceV1VoicesVoiceIdEditPostResponseContent(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
voiceId: voiceId,
xiApiKey: xiApiKey,
request: request);

using var response = await _httpClient.SendAsync(
Expand Down Expand Up @@ -104,6 +110,7 @@ partial void ProcessUpdateVoiceV1VoicesVoiceIdEditPostResponseContent(
/// Update Voice
/// </summary>
/// <param name="voiceId"></param>
/// <param name="xiApiKey"></param>
/// <param name="name"></param>
/// <param name="description"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
Expand All @@ -112,6 +119,7 @@ partial void ProcessUpdateVoiceV1VoicesVoiceIdEditPostResponseContent(
string voiceId,
string name,
string description,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new global::DeepInfra.UpdateVoiceIn
Expand All @@ -122,6 +130,7 @@ partial void ProcessUpdateVoiceV1VoicesVoiceIdEditPostResponseContent(

return await UpdateVoiceV1VoicesVoiceIdEditPostAsync(
voiceId: voiceId,
xiApiKey: xiApiKey,
request: request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand Down
Loading