Skip to content

Commit

Permalink
Merge pull request #4 from tryAGI/bot/update-openapi_202410010140
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 1, 2024
2 parents 0eb5913 + fc65b17 commit bbb17f0
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 7 deletions.
118 changes: 118 additions & 0 deletions src/libs/Tripo/Generated/OneOf.9.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,124 @@ public bool Validate()
return IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 || !IsValue1 && IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 || !IsValue1 && !IsValue2 && IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 || !IsValue1 && !IsValue2 && !IsValue3 && IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && IsValue7 && !IsValue8 && !IsValue9 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && IsValue8 && !IsValue9 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && IsValue9;
}

/// <summary>
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<T1, TResult>? value1 = null,
global::System.Func<T2, TResult>? value2 = null,
global::System.Func<T3, TResult>? value3 = null,
global::System.Func<T4, TResult>? value4 = null,
global::System.Func<T5, TResult>? value5 = null,
global::System.Func<T6, TResult>? value6 = null,
global::System.Func<T7, TResult>? value7 = null,
global::System.Func<T8, TResult>? value8 = null,
global::System.Func<T9, TResult>? value9 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1 && value1 != null)
{
return value1(Value1!);
}
else if (IsValue2 && value2 != null)
{
return value2(Value2!);
}
else if (IsValue3 && value3 != null)
{
return value3(Value3!);
}
else if (IsValue4 && value4 != null)
{
return value4(Value4!);
}
else if (IsValue5 && value5 != null)
{
return value5(Value5!);
}
else if (IsValue6 && value6 != null)
{
return value6(Value6!);
}
else if (IsValue7 && value7 != null)
{
return value7(Value7!);
}
else if (IsValue8 && value8 != null)
{
return value8(Value8!);
}
else if (IsValue9 && value9 != null)
{
return value9(Value9!);
}

return default(TResult);
}

/// <summary>
///
/// </summary>
public void Match(
global::System.Action<T1>? value1 = null,
global::System.Action<T2>? value2 = null,
global::System.Action<T3>? value3 = null,
global::System.Action<T4>? value4 = null,
global::System.Action<T5>? value5 = null,
global::System.Action<T6>? value6 = null,
global::System.Action<T7>? value7 = null,
global::System.Action<T8>? value8 = null,
global::System.Action<T9>? value9 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1)
{
value1?.Invoke(Value1!);
}
else if (IsValue2)
{
value2?.Invoke(Value2!);
}
else if (IsValue3)
{
value3?.Invoke(Value3!);
}
else if (IsValue4)
{
value4?.Invoke(Value4!);
}
else if (IsValue5)
{
value5?.Invoke(Value5!);
}
else if (IsValue6)
{
value6?.Invoke(Value6!);
}
else if (IsValue7)
{
value7?.Invoke(Value7!);
}
else if (IsValue8)
{
value8?.Invoke(Value8!);
}
else if (IsValue9)
{
value9?.Invoke(Value9!);
}
}

/// <summary>
///
/// </summary>
Expand Down
16 changes: 16 additions & 0 deletions src/libs/Tripo/Generated/Tripo.PathBuilder.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,20 @@ public PathBuilder AddOptionalParameter<T>(
/// <returns>The constructed URL.</returns>
public override string ToString() => _stringBuilder.ToString();
}

/// <summary>
///
/// </summary>
public class EndPointAuthorization
{
/// <summary>
///
/// </summary>
public string Name { get; set; } = string.Empty;

/// <summary>
///
/// </summary>
public string Value { get; set; } = string.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ public void AuthorizeUsingBearer(
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

_httpClient.DefaultRequestHeaders.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: "Bearer",
parameter: apiKey);
_authorization = new global::Tripo.EndPointAuthorization
{
Name = "Bearer",
Value = apiKey,
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ namespace Tripo
{
public sealed partial class TripoApi
{
/// <inheritdoc cref="TripoApi(global::System.Net.Http.HttpClient?, global::System.Uri?)"/>
/// <inheritdoc cref="TripoApi(global::System.Net.Http.HttpClient?, global::System.Uri?, global::Tripo.EndPointAuthorization?)"/>
public TripoApi(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null) : this(httpClient, baseUri)
global::System.Uri? baseUri = null,
global::Tripo.EndPointAuthorization? authorization = null) : this(httpClient, baseUri, authorization)
{
Authorizing(_httpClient, ref apiKey);

Expand Down
7 changes: 7 additions & 0 deletions src/libs/Tripo/Generated/Tripo.TripoApi.CreateTask.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ partial void ProcessCreateTaskResponseContent(
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));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _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
7 changes: 7 additions & 0 deletions src/libs/Tripo/Generated/Tripo.TripoApi.GetBalance.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ 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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
7 changes: 7 additions & 0 deletions src/libs/Tripo/Generated/Tripo.TripoApi.GetTask.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ 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);
}}

PrepareRequest(
client: _httpClient,
request: httpRequest);
Expand Down
7 changes: 7 additions & 0 deletions src/libs/Tripo/Generated/Tripo.TripoApi.UploadFile.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ partial void ProcessUploadFileResponseContent(
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));

if (_authorization != null)
{{
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: _authorization.Name,
parameter: _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: 6 additions & 2 deletions src/libs/Tripo/Generated/Tripo.TripoApi.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +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;

/// <summary>
///
Expand All @@ -29,13 +30,16 @@ public sealed partial class TripoApi : global::Tripo.ITripoApi, global::System.I
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <param name="baseUri"></param>
/// <param name="authorization"></param>
public TripoApi(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
global::System.Uri? baseUri = null,
global::Tripo.EndPointAuthorization? authorization = null)
{
_httpClient = httpClient ?? new global::System.Net.Http.HttpClient();
_httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl);
_authorization = authorization;

Initialized(_httpClient);
}
Expand Down

0 comments on commit bbb17f0

Please sign in to comment.