Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 31, 2024
1 parent 49d61c2 commit f1b6244
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 10 deletions.
39 changes: 39 additions & 0 deletions src/libs/Leonardo/Generated/JsonConverters.UnixTimestamp.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#nullable enable

namespace OpenApiGenerator.JsonConverters
{
/// <inheritdoc />
public class UnixTimestampJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::System.DateTimeOffset>
{
/// <inheritdoc />
public override global::System.DateTimeOffset Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
if (reader.TokenType == global::System.Text.Json.JsonTokenType.Number)
{
if (reader.TryGetInt64(out long unixTimestamp))
{
return global::System.DateTimeOffset.FromUnixTimeSeconds(unixTimestamp);
}
if (reader.TryGetInt32(out int unixTimestampInt))
{
return global::System.DateTimeOffset.FromUnixTimeSeconds(unixTimestampInt);
}
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::System.DateTimeOffset value,
global::System.Text.Json.JsonSerializerOptions options)
{
long unixTimestamp = value.ToUnixTimeSeconds();
writer.WriteNumberValue(unixTimestamp);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ partial void ProcessGetGenerationsByUserIdResponseContent(
/// <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::Leonardo.GetGenerationsByUserIdResponse> GetGenerationsByUserIdAsync(
int offset,
int limit,
string userId,
int offset = 0,
int limit = 10,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ partial void ProcessGetTextureGenerationByIdResponseContent(
/// <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::Leonardo.GetTextureGenerationByIdResponse> GetTextureGenerationByIdAsync(
int offset,
int limit,
string id,
global::Leonardo.GetTextureGenerationByIdRequest request,
int offset = 0,
int limit = 10,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ partial void ProcessGetTextureGenerationsByModelIdResponseContent(
/// <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::Leonardo.GetTextureGenerationsByModelIdResponse> GetTextureGenerationsByModelIdAsync(
int offset,
int limit,
string modelId,
global::Leonardo.GetTextureGenerationsByModelIdRequest request,
int offset = 0,
int limit = 10,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ partial void ProcessGet3DModelByIdResponseContent(
/// <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::Leonardo.Get3DModelByIdResponse> Get3DModelByIdAsync(
int offset,
int limit,
string id,
global::Leonardo.Get3DModelByIdRequest request,
int offset = 0,
int limit = 10,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ partial void ProcessGet3DModelsByUserIdResponseContent(
/// <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::Leonardo.Get3DModelsByUserIdResponse> Get3DModelsByUserIdAsync(
int offset,
int limit,
string userId,
global::Leonardo.Get3DModelsByUserIdRequest request,
int offset = 0,
int limit = 10,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
Expand Down

0 comments on commit f1b6244

Please sign in to comment.