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 Oct 23, 2024
1 parent 3986535 commit 67b0475
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 148 deletions.
15 changes: 15 additions & 0 deletions src/libs/Tripo/Generated/Tripo.ITripoApi.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ namespace Tripo
/// </summary>
public partial interface ITripoApi : global::System.IDisposable
{
/// <summary>
/// The HttpClient instance.
/// </summary>
public global::System.Net.Http.HttpClient HttpClient { get; }

/// <summary>
/// The base URL for the API.
/// </summary>
public System.Uri? BaseUri { get; }

/// <summary>
/// The authorizations to use for the requests.
/// </summary>
public global::System.Collections.Generic.List<global::Tripo.EndPointAuthorization> Authorizations { get; }

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public void AuthorizeUsingBearer(
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

_authorizations.Clear();
_authorizations.Add(new global::Tripo.EndPointAuthorization
Authorizations.Clear();
Authorizations.Add(new global::Tripo.EndPointAuthorization
{
Type = "Http",
Location = "Header",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ namespace Tripo
{
public sealed partial class TripoApi
{
/// <inheritdoc cref="TripoApi(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Tripo.EndPointAuthorization}?)"/>
/// <inheritdoc cref="TripoApi(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Tripo.EndPointAuthorization}?, bool)"/>
public TripoApi(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::System.Collections.Generic.List<global::Tripo.EndPointAuthorization>? authorizations = null) : this(httpClient, baseUri, authorizations)
global::System.Collections.Generic.List<global::Tripo.EndPointAuthorization>? authorizations = null,
bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient)
{
Authorizing(_httpClient, ref apiKey);
Authorizing(HttpClient, ref apiKey);

AuthorizeUsingBearer(apiKey);

Authorized(_httpClient);
Authorized(HttpClient);
}

partial void Authorizing(
Expand Down
68 changes: 34 additions & 34 deletions src/libs/Tripo/Generated/Tripo.TripoApi.CreateTask.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,79 +32,79 @@ partial void ProcessCreateTaskResponseContent(
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
client: HttpClient);
PrepareCreateTaskArguments(
httpClient: _httpClient,
httpClient: HttpClient,
request: request);

var __pathBuilder = new PathBuilder(
path: "/task",
baseUri: _httpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

foreach (var _authorization in _authorizations)
foreach (var __authorization in Authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
__httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: __authorization.Name,
parameter: __authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
else if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
encoding: global::System.Text.Encoding.UTF8,
mediaType: "application/json");
httpRequest.Content = __httpRequestContent;
__httpRequest.Content = __httpRequestContent;

PrepareRequest(
client: _httpClient,
request: httpRequest);
client: HttpClient,
request: __httpRequest);
PrepareCreateTaskRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
request: request);

using var response = await _httpClient.SendAsync(
request: 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);
client: HttpClient,
response: __response);
ProcessCreateTaskResponse(
httpClient: _httpClient,
httpResponseMessage: response);
httpClient: HttpClient,
httpResponseMessage: __response);

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

ProcessResponseContent(
client: _httpClient,
response: response,
client: HttpClient,
response: __response,
content: ref __content);
ProcessCreateTaskResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
httpClient: HttpClient,
httpResponseMessage: __response,
content: ref __content);

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

return
Expand All @@ -120,12 +120,12 @@ partial void ProcessCreateTaskResponseContent(
public async global::System.Threading.Tasks.Task<global::Tripo.SuccessTask> CreateTaskAsync(
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new global::Tripo.OneOf<global::Tripo.CreateTaskRequestVariant1, global::Tripo.CreateTaskRequestVariant2, global::Tripo.CreateTaskRequestVariant3, global::Tripo.CreateTaskRequestVariant4, global::Tripo.CreateTaskRequestVariant5, global::Tripo.CreateTaskRequestVariant6, global::Tripo.CreateTaskRequestVariant7, global::Tripo.CreateTaskRequestVariant8, global::Tripo.CreateTaskRequestVariant9>
var __request = new global::Tripo.OneOf<global::Tripo.CreateTaskRequestVariant1, global::Tripo.CreateTaskRequestVariant2, global::Tripo.CreateTaskRequestVariant3, global::Tripo.CreateTaskRequestVariant4, global::Tripo.CreateTaskRequestVariant5, global::Tripo.CreateTaskRequestVariant6, global::Tripo.CreateTaskRequestVariant7, global::Tripo.CreateTaskRequestVariant8, global::Tripo.CreateTaskRequestVariant9>
{
};

return await CreateTaskAsync(
request: request,
request: __request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
Expand Down
62 changes: 31 additions & 31 deletions src/libs/Tripo/Generated/Tripo.TripoApi.GetBalance.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,71 +28,71 @@ partial void ProcessGetBalanceResponseContent(
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
client: HttpClient);
PrepareGetBalanceArguments(
httpClient: _httpClient);
httpClient: HttpClient);

var __pathBuilder = new PathBuilder(
path: "/user/balance",
baseUri: _httpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

foreach (var _authorization in _authorizations)
foreach (var __authorization in Authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
__httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: __authorization.Name,
parameter: __authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
else if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}

PrepareRequest(
client: _httpClient,
request: httpRequest);
client: HttpClient,
request: __httpRequest);
PrepareGetBalanceRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest);
httpClient: HttpClient,
httpRequestMessage: __httpRequest);

using var response = await _httpClient.SendAsync(
request: 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);
client: HttpClient,
response: __response);
ProcessGetBalanceResponse(
httpClient: _httpClient,
httpResponseMessage: response);
httpClient: HttpClient,
httpResponseMessage: __response);

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

ProcessResponseContent(
client: _httpClient,
response: response,
client: HttpClient,
response: __response,
content: ref __content);
ProcessGetBalanceResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
httpClient: HttpClient,
httpResponseMessage: __response,
content: ref __content);

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

return
Expand Down
62 changes: 31 additions & 31 deletions src/libs/Tripo/Generated/Tripo.TripoApi.GetTask.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,73 +32,73 @@ partial void ProcessGetTaskResponseContent(
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
client: HttpClient);
PrepareGetTaskArguments(
httpClient: _httpClient,
httpClient: HttpClient,
taskId: ref taskId);

var __pathBuilder = new PathBuilder(
path: $"/task/{taskId}",
baseUri: _httpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));

foreach (var _authorization in _authorizations)
foreach (var __authorization in Authorizations)
{
if (_authorization.Type == "Http" ||
_authorization.Type == "OAuth2")
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _authorization.Value);
__httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: __authorization.Name,
parameter: __authorization.Value);
}
else if (_authorization.Type == "ApiKey" &&
_authorization.Location == "Header")
else if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header")
{
httpRequest.Headers.Add(_authorization.Name, _authorization.Value);
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}

PrepareRequest(
client: _httpClient,
request: httpRequest);
client: HttpClient,
request: __httpRequest);
PrepareGetTaskRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
taskId: taskId);

using var response = await _httpClient.SendAsync(
request: 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);
client: HttpClient,
response: __response);
ProcessGetTaskResponse(
httpClient: _httpClient,
httpResponseMessage: response);
httpClient: HttpClient,
httpResponseMessage: __response);

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

ProcessResponseContent(
client: _httpClient,
response: response,
client: HttpClient,
response: __response,
content: ref __content);
ProcessGetTaskResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
httpClient: HttpClient,
httpResponseMessage: __response,
content: ref __content);

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

return
Expand Down
Loading

0 comments on commit 67b0475

Please sign in to comment.