Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 9, 2024
1 parent 88de79c commit 0e20149
Show file tree
Hide file tree
Showing 11 changed files with 871 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ partial void ProcessAccountUpdateDetailsV1MePatchResponseContent(
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: new global::System.Net.Http.HttpMethod("PATCH"),
method: global::System.Net.Http.HttpMethod.Patch,

Check failure on line 43 in src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.AccountUpdateDetailsV1MePatch.g.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

'HttpMethod' does not contain a definition for 'Patch'

Check failure on line 43 in src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.AccountUpdateDetailsV1MePatch.g.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

'HttpMethod' does not contain a definition for 'Patch'

Check failure on line 43 in src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.AccountUpdateDetailsV1MePatch.g.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

'HttpMethod' does not contain a definition for 'Patch'

Check failure on line 43 in src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.AccountUpdateDetailsV1MePatch.g.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

'HttpMethod' does not contain a definition for 'Patch'
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/me", global::System.UriKind.RelativeOrAbsolute));

Check failure on line 44 in src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.AccountUpdateDetailsV1MePatch.g.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

Argument 2: cannot convert from 'System.Uri' to 'string'

Check failure on line 44 in src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.AccountUpdateDetailsV1MePatch.g.cs

View workflow job for this annotation

GitHub Actions / Build and test / Build, test and publish

Argument 2: cannot convert from 'System.Uri' to 'string'
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: global::System.Text.Json.JsonSerializer.Serialize(request, global::DeepInfra.SourceGenerationContext.Default.MeIn),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

#nullable enable

namespace DeepInfra
{
public partial class DeepInfraApi
{
partial void PrepareCreateVoiceV1VoicesAddPostArguments(
global::System.Net.Http.HttpClient httpClient);
partial void PrepareCreateVoiceV1VoicesAddPostRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage);
partial void ProcessCreateVoiceV1VoicesAddPostResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessCreateVoiceV1VoicesAddPostResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Create Voice<br/>
/// Create a new voice
/// </summary>
/// <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.Voice> CreateVoiceV1VoicesAddPostAsync(
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareCreateVoiceV1VoicesAddPostArguments(
httpClient: _httpClient);

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));

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareCreateVoiceV1VoicesAddPostRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessCreateVoiceV1VoicesAddPostResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessCreateVoiceV1VoicesAddPostResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException ex)
{
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::System.Text.Json.JsonSerializer.Deserialize(__content, global::DeepInfra.SourceGenerationContext.Default.Voice) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

#nullable enable

namespace DeepInfra
{
public partial class DeepInfraApi
{
partial void PrepareDeleteVoiceV1VoicesVoiceIdDeleteArguments(
global::System.Net.Http.HttpClient httpClient,
ref string voiceId);
partial void PrepareDeleteVoiceV1VoicesVoiceIdDeleteRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string voiceId);
partial void ProcessDeleteVoiceV1VoicesVoiceIdDeleteResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessDeleteVoiceV1VoicesVoiceIdDeleteResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Delete Voice
/// </summary>
/// <param name="voiceId"></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<object> DeleteVoiceV1VoicesVoiceIdDeleteAsync(
string voiceId,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareDeleteVoiceV1VoicesVoiceIdDeleteArguments(
httpClient: _httpClient,
voiceId: ref voiceId);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Delete,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/voices/{voiceId}", global::System.UriKind.RelativeOrAbsolute));

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareDeleteVoiceV1VoicesVoiceIdDeleteRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
voiceId: voiceId);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessDeleteVoiceV1VoicesVoiceIdDeleteResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessDeleteVoiceV1VoicesVoiceIdDeleteResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException ex)
{
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::System.Text.Json.JsonSerializer.Deserialize(__content, global::DeepInfra.SourceGenerationContext.Default.Object) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

#nullable enable

namespace DeepInfra
{
public partial class DeepInfraApi
{
partial void PrepareGetVoiceV1VoicesVoiceIdGetArguments(
global::System.Net.Http.HttpClient httpClient,
ref string voiceId);
partial void PrepareGetVoiceV1VoicesVoiceIdGetRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string voiceId);
partial void ProcessGetVoiceV1VoicesVoiceIdGetResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessGetVoiceV1VoicesVoiceIdGetResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Get Voice<br/>
/// Get a voice by its id
/// </summary>
/// <param name="voiceId"></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.Voice> GetVoiceV1VoicesVoiceIdGetAsync(
string voiceId,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareGetVoiceV1VoicesVoiceIdGetArguments(
httpClient: _httpClient,
voiceId: ref voiceId);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1/voices/{voiceId}", global::System.UriKind.RelativeOrAbsolute));

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareGetVoiceV1VoicesVoiceIdGetRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
voiceId: voiceId);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessGetVoiceV1VoicesVoiceIdGetResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessGetVoiceV1VoicesVoiceIdGetResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException ex)
{
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::System.Text.Json.JsonSerializer.Deserialize(__content, global::DeepInfra.SourceGenerationContext.Default.Voice) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

#nullable enable

namespace DeepInfra
{
public partial class DeepInfraApi
{
partial void PrepareGetVoicesV1VoicesGetArguments(
global::System.Net.Http.HttpClient httpClient);
partial void PrepareGetVoicesV1VoicesGetRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage);
partial void ProcessGetVoicesV1VoicesGetResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessGetVoicesV1VoicesGetResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Get Voices<br/>
/// Get available voices for a given user
/// </summary>
/// <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(
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareGetVoicesV1VoicesGetArguments(
httpClient: _httpClient);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/voices", global::System.UriKind.RelativeOrAbsolute));

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareGetVoicesV1VoicesGetRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessGetVoicesV1VoicesGetResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessGetVoicesV1VoicesGetResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException ex)
{
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::System.Text.Json.JsonSerializer.Deserialize(__content, global::DeepInfra.SourceGenerationContext.Default.GetVoicesOut) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
}
}
Loading

0 comments on commit 0e20149

Please sign in to comment.