From fc65b1715a4f741164b8ee4ccfa5e7281f30ae9e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 1 Oct 2024 01:41:05 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- src/libs/Tripo/Generated/OneOf.9.g.cs | 118 ++++++++++++++++++ .../Tripo/Generated/Tripo.PathBuilder.g.cs | 16 +++ .../Tripo.TripoApi.Authorizations.Bearer.g.cs | 8 +- .../Tripo.TripoApi.Constructors.Bearer.g.cs | 5 +- .../Generated/Tripo.TripoApi.CreateTask.g.cs | 7 ++ .../Generated/Tripo.TripoApi.GetBalance.g.cs | 7 ++ .../Generated/Tripo.TripoApi.GetTask.g.cs | 7 ++ .../Generated/Tripo.TripoApi.UploadFile.g.cs | 7 ++ src/libs/Tripo/Generated/Tripo.TripoApi.g.cs | 8 +- 9 files changed, 176 insertions(+), 7 deletions(-) diff --git a/src/libs/Tripo/Generated/OneOf.9.g.cs b/src/libs/Tripo/Generated/OneOf.9.g.cs index 870c1eb..c2182e9 100644 --- a/src/libs/Tripo/Generated/OneOf.9.g.cs +++ b/src/libs/Tripo/Generated/OneOf.9.g.cs @@ -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; } + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + global::System.Func? value4 = null, + global::System.Func? value5 = null, + global::System.Func? value6 = null, + global::System.Func? value7 = null, + global::System.Func? value8 = null, + global::System.Func? 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); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + global::System.Action? value3 = null, + global::System.Action? value4 = null, + global::System.Action? value5 = null, + global::System.Action? value6 = null, + global::System.Action? value7 = null, + global::System.Action? value8 = null, + global::System.Action? 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!); + } + } + /// /// /// diff --git a/src/libs/Tripo/Generated/Tripo.PathBuilder.g.cs b/src/libs/Tripo/Generated/Tripo.PathBuilder.g.cs index a18e0f8..3034b07 100644 --- a/src/libs/Tripo/Generated/Tripo.PathBuilder.g.cs +++ b/src/libs/Tripo/Generated/Tripo.PathBuilder.g.cs @@ -224,4 +224,20 @@ public PathBuilder AddOptionalParameter( /// The constructed URL. public override string ToString() => _stringBuilder.ToString(); } + + /// + /// + /// + public class EndPointAuthorization + { + /// + /// + /// + public string Name { get; set; } = string.Empty; + + /// + /// + /// + public string Value { get; set; } = string.Empty; + } } \ No newline at end of file diff --git a/src/libs/Tripo/Generated/Tripo.TripoApi.Authorizations.Bearer.g.cs b/src/libs/Tripo/Generated/Tripo.TripoApi.Authorizations.Bearer.g.cs index 23c9a15..80b9c24 100644 --- a/src/libs/Tripo/Generated/Tripo.TripoApi.Authorizations.Bearer.g.cs +++ b/src/libs/Tripo/Generated/Tripo.TripoApi.Authorizations.Bearer.g.cs @@ -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, + }; } } } \ No newline at end of file diff --git a/src/libs/Tripo/Generated/Tripo.TripoApi.Constructors.Bearer.g.cs b/src/libs/Tripo/Generated/Tripo.TripoApi.Constructors.Bearer.g.cs index c17ae40..1970a89 100644 --- a/src/libs/Tripo/Generated/Tripo.TripoApi.Constructors.Bearer.g.cs +++ b/src/libs/Tripo/Generated/Tripo.TripoApi.Constructors.Bearer.g.cs @@ -5,11 +5,12 @@ namespace Tripo { public sealed partial class TripoApi { - /// + /// 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); diff --git a/src/libs/Tripo/Generated/Tripo.TripoApi.CreateTask.g.cs b/src/libs/Tripo/Generated/Tripo.TripoApi.CreateTask.g.cs index e318396..e19bb60 100644 --- a/src/libs/Tripo/Generated/Tripo.TripoApi.CreateTask.g.cs +++ b/src/libs/Tripo/Generated/Tripo.TripoApi.CreateTask.g.cs @@ -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, diff --git a/src/libs/Tripo/Generated/Tripo.TripoApi.GetBalance.g.cs b/src/libs/Tripo/Generated/Tripo.TripoApi.GetBalance.g.cs index 2b3e3b1..04d8f71 100644 --- a/src/libs/Tripo/Generated/Tripo.TripoApi.GetBalance.g.cs +++ b/src/libs/Tripo/Generated/Tripo.TripoApi.GetBalance.g.cs @@ -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); diff --git a/src/libs/Tripo/Generated/Tripo.TripoApi.GetTask.g.cs b/src/libs/Tripo/Generated/Tripo.TripoApi.GetTask.g.cs index 1fb1e3a..3ecd446 100644 --- a/src/libs/Tripo/Generated/Tripo.TripoApi.GetTask.g.cs +++ b/src/libs/Tripo/Generated/Tripo.TripoApi.GetTask.g.cs @@ -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); diff --git a/src/libs/Tripo/Generated/Tripo.TripoApi.UploadFile.g.cs b/src/libs/Tripo/Generated/Tripo.TripoApi.UploadFile.g.cs index ad7b147..0dc8d59 100644 --- a/src/libs/Tripo/Generated/Tripo.TripoApi.UploadFile.g.cs +++ b/src/libs/Tripo/Generated/Tripo.TripoApi.UploadFile.g.cs @@ -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()) diff --git a/src/libs/Tripo/Generated/Tripo.TripoApi.g.cs b/src/libs/Tripo/Generated/Tripo.TripoApi.g.cs index e878378..de492a6 100644 --- a/src/libs/Tripo/Generated/Tripo.TripoApi.g.cs +++ b/src/libs/Tripo/Generated/Tripo.TripoApi.g.cs @@ -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; /// /// @@ -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. /// /// - /// + /// + /// 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); }