-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from tryAGI/bot/update-openapi_202411271236
feat:@coderabbitai
- Loading branch information
Showing
5 changed files
with
338 additions
and
0 deletions.
There are no files selected for viewing
178 changes: 178 additions & 0 deletions
178
src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.GetUserLoras.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
|
||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
public partial class DeepInfraApi | ||
{ | ||
partial void PrepareGetUserLorasArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
ref string? xiApiKey); | ||
partial void PrepareGetUserLorasRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
string? xiApiKey); | ||
partial void ProcessGetUserLorasResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessGetUserLorasResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Get User Loras | ||
/// </summary> | ||
/// <param name="xiApiKey"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::DeepInfra.ApiException"></exception> | ||
public async global::System.Threading.Tasks.Task<string> GetUserLorasAsync( | ||
string? xiApiKey = default, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
PrepareArguments( | ||
client: HttpClient); | ||
PrepareGetUserLorasArguments( | ||
httpClient: HttpClient, | ||
xiApiKey: ref xiApiKey); | ||
|
||
var __pathBuilder = new PathBuilder( | ||
path: "/v1/user/loras", | ||
baseUri: HttpClient.BaseAddress); | ||
var __path = __pathBuilder.ToString(); | ||
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) | ||
{ | ||
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); | ||
} | ||
} | ||
|
||
if (xiApiKey != default) | ||
{ | ||
__httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); | ||
} | ||
|
||
|
||
PrepareRequest( | ||
client: HttpClient, | ||
request: __httpRequest); | ||
PrepareGetUserLorasRequest( | ||
httpClient: HttpClient, | ||
httpRequestMessage: __httpRequest, | ||
xiApiKey: xiApiKey); | ||
|
||
using var __response = await HttpClient.SendAsync( | ||
request: __httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: HttpClient, | ||
response: __response); | ||
ProcessGetUserLorasResponse( | ||
httpClient: HttpClient, | ||
httpResponseMessage: __response); | ||
// Validation Error | ||
if ((int)__response.StatusCode == 422) | ||
{ | ||
string? __content_422 = null; | ||
global::DeepInfra.HTTPValidationError? __value_422 = null; | ||
if (ReadResponseAsString) | ||
{ | ||
__content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
__value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); | ||
} | ||
else | ||
{ | ||
var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); | ||
__value_422 = await global::DeepInfra.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); | ||
} | ||
|
||
throw new global::DeepInfra.ApiException<global::DeepInfra.HTTPValidationError>( | ||
message: __response.ReasonPhrase ?? string.Empty, | ||
statusCode: __response.StatusCode) | ||
{ | ||
ResponseBody = __content_422, | ||
ResponseObject = __value_422, | ||
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( | ||
__response.Headers, | ||
h => h.Key, | ||
h => h.Value), | ||
}; | ||
} | ||
|
||
if (ReadResponseAsString) | ||
{ | ||
var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: HttpClient, | ||
response: __response, | ||
content: ref __content); | ||
ProcessGetUserLorasResponseContent( | ||
httpClient: HttpClient, | ||
httpResponseMessage: __response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
__response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException __ex) | ||
{ | ||
throw new global::DeepInfra.ApiException( | ||
message: __content ?? __response.ReasonPhrase ?? string.Empty, | ||
innerException: __ex, | ||
statusCode: __response.StatusCode) | ||
{ | ||
ResponseBody = __content, | ||
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( | ||
__response.Headers, | ||
h => h.Key, | ||
h => h.Value), | ||
}; | ||
} | ||
|
||
return __content; | ||
} | ||
else | ||
{ | ||
try | ||
{ | ||
__response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException __ex) | ||
{ | ||
throw new global::DeepInfra.ApiException( | ||
message: __response.ReasonPhrase ?? string.Empty, | ||
innerException: __ex, | ||
statusCode: __response.StatusCode) | ||
{ | ||
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( | ||
__response.Headers, | ||
h => h.Key, | ||
h => h.Value), | ||
}; | ||
} | ||
|
||
var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
return __content; | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraApi.GetUserLoras.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
public partial interface IDeepInfraApi | ||
{ | ||
/// <summary> | ||
/// Get User Loras | ||
/// </summary> | ||
/// <param name="xiApiKey"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::DeepInfra.ApiException"></exception> | ||
global::System.Threading.Tasks.Task<string> GetUserLorasAsync( | ||
string? xiApiKey = default, | ||
global::System.Threading.CancellationToken cancellationToken = default); | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.Json.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
public sealed partial class GetUserLorasV1UserLorasGetResponse | ||
{ | ||
/// <summary> | ||
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext. | ||
/// </summary> | ||
public string ToJson( | ||
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Serialize( | ||
this, | ||
this.GetType(), | ||
jsonSerializerContext); | ||
} | ||
|
||
/// <summary> | ||
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public string ToJson( | ||
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Serialize( | ||
this, | ||
jsonSerializerOptions); | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON string using the provided JsonSerializerContext. | ||
/// </summary> | ||
public static global::DeepInfra.GetUserLorasV1UserLorasGetResponse? FromJson( | ||
string json, | ||
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Deserialize( | ||
json, | ||
typeof(global::DeepInfra.GetUserLorasV1UserLorasGetResponse), | ||
jsonSerializerContext) as global::DeepInfra.GetUserLorasV1UserLorasGetResponse; | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON string using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public static global::DeepInfra.GetUserLorasV1UserLorasGetResponse? FromJson( | ||
string json, | ||
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.Deserialize<global::DeepInfra.GetUserLorasV1UserLorasGetResponse>( | ||
json, | ||
jsonSerializerOptions); | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON stream using the provided JsonSerializerContext. | ||
/// </summary> | ||
public static async global::System.Threading.Tasks.ValueTask<global::DeepInfra.GetUserLorasV1UserLorasGetResponse?> FromJsonStreamAsync( | ||
global::System.IO.Stream jsonStream, | ||
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) | ||
{ | ||
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( | ||
jsonStream, | ||
typeof(global::DeepInfra.GetUserLorasV1UserLorasGetResponse), | ||
jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetUserLorasV1UserLorasGetResponse; | ||
} | ||
|
||
/// <summary> | ||
/// Deserializes a JSON stream using the provided JsonSerializerOptions. | ||
/// </summary> | ||
#if NET8_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] | ||
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] | ||
#endif | ||
public static global::System.Threading.Tasks.ValueTask<global::DeepInfra.GetUserLorasV1UserLorasGetResponse?> FromJsonStreamAsync( | ||
global::System.IO.Stream jsonStream, | ||
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) | ||
{ | ||
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::DeepInfra.GetUserLorasV1UserLorasGetResponse?>( | ||
jsonStream, | ||
jsonSerializerOptions); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class GetUserLorasV1UserLorasGetResponse | ||
{ | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="GetUserLorasV1UserLorasGetResponse" /> class. | ||
/// </summary> | ||
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] | ||
public GetUserLorasV1UserLorasGetResponse( | ||
) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters