-
-
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 #29 from tryAGI/bot/update-openapi_202408121821
feat:Updated OpenAPI spec
- Loading branch information
Showing
5 changed files
with
312 additions
and
89 deletions.
There are no files selected for viewing
118 changes: 118 additions & 0 deletions
118
src/libs/DeepInfra/Generated/DeepInfra.DeepInfraApi.AccountSetUsernameV1MeUsernamePatch.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,118 @@ | ||
|
||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
public partial class DeepInfraApi | ||
{ | ||
partial void PrepareAccountSetUsernameV1MeUsernamePatchArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::DeepInfra.MeUsername request); | ||
partial void PrepareAccountSetUsernameV1MeUsernamePatchRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
global::DeepInfra.MeUsername request); | ||
partial void ProcessAccountSetUsernameV1MeUsernamePatchResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessAccountSetUsernameV1MeUsernamePatchResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Account Set Username | ||
/// </summary> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::DeepInfra.AccountSetUsernameV1MeUsernamePatchResponse> AccountSetUsernameV1MeUsernamePatchAsync( | ||
global::DeepInfra.MeUsername request, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
request = request ?? throw new global::System.ArgumentNullException(nameof(request)); | ||
|
||
PrepareArguments( | ||
client: _httpClient); | ||
PrepareAccountSetUsernameV1MeUsernamePatchArguments( | ||
httpClient: _httpClient, | ||
request: request); | ||
|
||
using var httpRequest = new global::System.Net.Http.HttpRequestMessage( | ||
method: new global::System.Net.Http.HttpMethod("PATCH"), | ||
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/v1/me/username", global::System.UriKind.RelativeOrAbsolute)); | ||
var __httpRequestContent = new global::System.Net.Http.StringContent( | ||
content: global::System.Text.Json.JsonSerializer.Serialize(request, global::DeepInfra.SourceGenerationContext.Default.MeUsername), | ||
encoding: global::System.Text.Encoding.UTF8, | ||
mediaType: "application/json"); | ||
httpRequest.Content = __httpRequestContent; | ||
|
||
PrepareRequest( | ||
client: _httpClient, | ||
request: httpRequest); | ||
PrepareAccountSetUsernameV1MeUsernamePatchRequest( | ||
httpClient: _httpClient, | ||
httpRequestMessage: httpRequest, | ||
request: request); | ||
|
||
using var response = await _httpClient.SendAsync( | ||
request: httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: _httpClient, | ||
response: response); | ||
ProcessAccountSetUsernameV1MeUsernamePatchResponse( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response); | ||
|
||
var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: _httpClient, | ||
response: response, | ||
content: ref __content); | ||
ProcessAccountSetUsernameV1MeUsernamePatchResponseContent( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException ex) | ||
{ | ||
throw new global::System.InvalidOperationException(__content, ex); | ||
} | ||
|
||
return | ||
global::System.Text.Json.JsonSerializer.Deserialize(__content, global::DeepInfra.SourceGenerationContext.Default.AccountSetUsernameV1MeUsernamePatchResponse) ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
|
||
/// <summary> | ||
/// Account Set Username | ||
/// </summary> | ||
/// <param name="username"> | ||
/// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. | ||
/// </param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::DeepInfra.AccountSetUsernameV1MeUsernamePatchResponse> AccountSetUsernameV1MeUsernamePatchAsync( | ||
string username, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
var request = new global::DeepInfra.MeUsername | ||
{ | ||
Username = username, | ||
}; | ||
|
||
return await AccountSetUsernameV1MeUsernamePatchAsync( | ||
request: request, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ibs/DeepInfra/Generated/DeepInfra.Models.AccountSetUsernameV1MeUsernamePatchResponse.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,18 @@ | ||
|
||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class AccountSetUsernameV1MeUsernamePatchResponse | ||
{ | ||
|
||
/// <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>(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/libs/DeepInfra/Generated/DeepInfra.Models.MeUsername.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,24 @@ | ||
|
||
#nullable enable | ||
|
||
namespace DeepInfra | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class MeUsername | ||
{ | ||
/// <summary> | ||
/// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("username")] | ||
[global::System.Text.Json.Serialization.JsonRequired] | ||
public required string Username { get; set; } | ||
|
||
/// <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>(); | ||
} | ||
} |
Oops, something went wrong.