Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libs/Recraft/Generated/Recraft.Exceptions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
/// <param name="statusCode">The HTTP status code of the response.</param>
public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException)
public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException)
{
StatusCode = statusCode;
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
/// <param name="statusCode">The HTTP status code of the response.</param>
public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode)
public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode)
{
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ partial void ProcessCreativeUpscaleResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -146,18 +150,24 @@ partial void ProcessCreativeUpscaleResponseContent(
h => h.Value),
};
}

return
global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -170,16 +180,6 @@ partial void ProcessCreativeUpscaleResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ partial void ProcessCrispUpscaleResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -146,18 +150,24 @@ partial void ProcessCrispUpscaleResponseContent(
h => h.Value),
};
}

return
global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -170,16 +180,6 @@ partial void ProcessCrispUpscaleResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,12 @@ partial void ProcessEraseRegionResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -150,18 +154,24 @@ partial void ProcessEraseRegionResponseContent(
h => h.Value),
};
}

return
global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -174,16 +184,6 @@ partial void ProcessEraseRegionResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ partial void ProcessGenerateBackgroundResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -122,18 +126,24 @@ partial void ProcessGenerateBackgroundResponseContent(
h => h.Value),
};
}

return
global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -146,16 +156,6 @@ partial void ProcessGenerateBackgroundResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ partial void ProcessGenerateImageResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -128,18 +132,24 @@ partial void ProcessGenerateImageResponseContent(
h => h.Value),
};
}

return
global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -152,16 +162,6 @@ partial void ProcessGenerateImageResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ partial void ProcessImageToImageResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -218,18 +222,24 @@ partial void ProcessImageToImageResponseContent(
h => h.Value),
};
}

return
global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Recraft.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -242,16 +252,6 @@ partial void ProcessImageToImageResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

Expand Down
Loading
Loading