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:@coderabbitai #5

Merged
merged 1 commit into from
Oct 1, 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
5 changes: 5 additions & 0 deletions src/libs/Tripo/Generated/JsonSerializerContextTypes.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ namespace Tripo
/// </summary>
public sealed partial class JsonSerializerContextTypes
{
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.Dictionary<string, string>? StringStringDictionary { get; set; }

/// <summary>
///
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions src/libs/Tripo/Generated/Tripo.PathBuilder.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,16 @@ public PathBuilder AddOptionalParameter<T>(
/// </summary>
public class EndPointAuthorization
{
/// <summary>
///
/// </summary>
public string Type { get; set; } = string.Empty;

/// <summary>
///
/// </summary>
public string Location { get; set; } = string.Empty;

/// <summary>
///
/// </summary>
Expand Down
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::Tripo.EndPointAuthorization
_authorizations.Clear();
_authorizations.Add(new global::Tripo.EndPointAuthorization
{
Type = "Http",
Location = "Header",
Name = "Bearer",
Value = apiKey,
};
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace Tripo
{
public sealed partial class TripoApi
{
/// <inheritdoc cref="TripoApi(global::System.Net.Http.HttpClient?, global::System.Uri?, global::Tripo.EndPointAuthorization?)"/>
/// <inheritdoc cref="TripoApi(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Tripo.EndPointAuthorization}?)"/>
public TripoApi(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null,
global::Tripo.EndPointAuthorization? authorization = null) : this(httpClient, baseUri, authorization)
global::System.Collections.Generic.List<global::Tripo.EndPointAuthorization>? authorizations = null) : this(httpClient, baseUri, authorizations)
{
Authorizing(_httpClient, ref apiKey);

Expand Down
21 changes: 15 additions & 6 deletions src/libs/Tripo/Generated/Tripo.TripoApi.CreateTask.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ partial void ProcessCreateTaskResponseContent(
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/Tripo/Generated/Tripo.TripoApi.GetBalance.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,21 @@ partial void ProcessGetBalanceResponseContent(
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
21 changes: 15 additions & 6 deletions src/libs/Tripo/Generated/Tripo.TripoApi.GetTask.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ partial void ProcessGetTaskResponseContent(
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
21 changes: 15 additions & 6 deletions src/libs/Tripo/Generated/Tripo.TripoApi.UploadFile.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,21 @@ partial void ProcessUploadFileResponseContent(
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.ByteArrayContent(request.File ?? global::System.Array.Empty<byte>())
Expand Down
8 changes: 4 additions & 4 deletions src/libs/Tripo/Generated/Tripo.TripoApi.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class TripoApi : global::Tripo.ITripoApi, global::System.I
public const string BaseUrl = "https://api.tripo3d.ai/v2/openapi";

private readonly global::System.Net.Http.HttpClient _httpClient;
private global::Tripo.EndPointAuthorization? _authorization;
private global::System.Collections.Generic.List<global::Tripo.EndPointAuthorization> _authorizations;

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

Initialized(_httpClient);
}
Expand Down