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:Updated OpenAPI spec #6

Closed
wants to merge 1 commit into from
Closed
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 @@ -40,8 +40,8 @@
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),
encoding: global::System.Text.Encoding.UTF8,
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
Loading