diff --git a/src/libs/Picsart/Generated/Picsart.Exceptions.g.cs b/src/libs/Picsart/Generated/Picsart.Exceptions.g.cs
index 5aa3f54..365bdfd 100644
--- a/src/libs/Picsart/Generated/Picsart.Exceptions.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.Exceptions.g.cs
@@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception
/// The HTTP status code of the response.
///
public global::System.Net.HttpStatusCode StatusCode { get; }
+
///
/// The response body as a string, or null if the body could not be read.
/// This is always populated for error responses regardless of the ReadResponseAsString setting.
/// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read.
///
public string? ResponseBody { get; set; }
+
///
/// The response headers.
///
public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; }
+
///
/// Initializes a new instance of the class.
///
@@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl
{
StatusCode = statusCode;
}
+
+ ///
+ /// Constructs an instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain when the hierarchy is disabled.
+ ///
+ /// The HTTP status code of the response.
+ /// The error message.
+ /// An inner exception, when one is available.
+ /// The response headers; consulted for 429 Retry-After parsing when present.
+ public static global::Picsart.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::Picsart.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body and headers populated.
+ ///
+ public static global::Picsart.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException,
+ string? responseBody,
+ global::System.Collections.Generic.Dictionary>? responseHeaders)
+ {
+ var exception = global::Picsart.ApiException.Create(statusCode, message, innerException, responseHeaders);
+ exception.ResponseBody = responseBody;
+ exception.ResponseHeaders = responseHeaders;
+ return exception;
+ }
+
+ ///
+ /// Parses a Retry-After response header (delta-seconds or HTTP-date) into a .
+ /// Returns null when the header is missing or unparseable. Public so consumer code that observes
+ /// directly can recover the value without re-implementing the parser.
+ ///
+ public static global::System.TimeSpan? TryParseRetryAfter(
+ global::System.Collections.Generic.IDictionary>? headers)
+ {
+ if (headers == null)
+ {
+ return null;
+ }
+
+ global::System.Collections.Generic.IEnumerable? values = null;
+ foreach (var entry in headers)
+ {
+ if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase))
+ {
+ values = entry.Value;
+ break;
+ }
+ }
+
+ if (values == null)
+ {
+ return null;
+ }
+
+ string? raw = null;
+ foreach (var value in values)
+ {
+ if (!string.IsNullOrWhiteSpace(value))
+ {
+ raw = value.Trim();
+ break;
+ }
+ }
+
+ if (string.IsNullOrEmpty(raw))
+ {
+ return null;
+ }
+
+ if (int.TryParse(
+ raw,
+ global::System.Globalization.NumberStyles.Integer,
+ global::System.Globalization.CultureInfo.InvariantCulture,
+ out var seconds) && seconds >= 0)
+ {
+ return global::System.TimeSpan.FromSeconds(seconds);
+ }
+
+ if (global::System.DateTimeOffset.TryParse(
+ raw,
+ global::System.Globalization.CultureInfo.InvariantCulture,
+ global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal,
+ out var when))
+ {
+ var delta = when - global::System.DateTimeOffset.UtcNow;
+ return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero;
+ }
+
+ return null;
+ }
}
///
@@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode
public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode)
{
}
+
+ ///
+ /// Constructs an whose runtime type matches the response status code when the typed exception hierarchy is enabled.
+ ///
+ /// The HTTP status code of the response.
+ /// The error message.
+ /// An inner exception, when one is available.
+ /// The response headers; consulted for 429 Retry-After parsing when present.
+ public static new global::Picsart.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::Picsart.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body, object, and headers populated.
+ ///
+ public static global::Picsart.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException,
+ string? responseBody,
+ T? responseObject,
+ global::System.Collections.Generic.Dictionary>? responseHeaders)
+ {
+ var exception = global::Picsart.ApiException.Create(statusCode, message, innerException, responseHeaders);
+ exception.ResponseBody = responseBody;
+ exception.ResponseObject = responseObject;
+ exception.ResponseHeaders = responseHeaders;
+ return exception;
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs
index 96fe283..a66b923 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs
@@ -363,18 +363,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -401,18 +400,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -439,18 +437,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -477,18 +474,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -515,18 +511,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -553,18 +548,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -591,18 +585,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -629,18 +622,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -667,18 +659,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -705,18 +696,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -743,18 +733,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -781,18 +770,17 @@ partial void ProcessGenaiExpandImageResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -826,17 +814,15 @@ partial void ProcessGenaiExpandImageResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -873,17 +859,15 @@ partial void ProcessGenaiExpandImageResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs
index 7115b7c..80f6ea3 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs
@@ -361,18 +361,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -399,18 +398,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -437,18 +435,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -475,18 +472,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -513,18 +509,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -551,18 +546,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -589,18 +583,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -627,18 +620,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -665,18 +657,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -703,18 +694,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -741,18 +731,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -779,18 +768,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -824,17 +812,15 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -871,17 +857,15 @@ partial void ProcessGenaiGenerateImageBleedResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs
index 7708e48..476d13c 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs
@@ -359,18 +359,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -397,18 +396,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -435,18 +433,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -473,18 +470,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -511,18 +507,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -549,18 +544,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -587,18 +581,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -625,18 +618,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -663,18 +655,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -701,18 +692,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -739,18 +729,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -777,18 +766,17 @@ partial void ProcessGenaiImageInpaintingResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -822,17 +810,15 @@ partial void ProcessGenaiImageInpaintingResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -869,17 +855,15 @@ partial void ProcessGenaiImageInpaintingResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs
index f004c10..04f0092 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs
@@ -353,18 +353,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -391,18 +390,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -429,18 +427,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -467,18 +464,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -505,18 +501,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -543,18 +538,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -581,18 +575,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -619,18 +612,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -657,18 +649,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -695,18 +686,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -733,18 +723,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -771,18 +760,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -816,17 +804,15 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -863,17 +849,15 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs
index 8a9843e..22f77b8 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs
@@ -365,18 +365,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -403,18 +402,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -441,18 +439,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -479,18 +476,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -517,18 +513,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -555,18 +550,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -593,18 +587,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -631,18 +624,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -669,18 +661,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -707,18 +698,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -745,18 +735,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -783,18 +772,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -828,17 +816,15 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -875,17 +861,15 @@ partial void ProcessGenaiImageOutpaintingResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs
index 0cb7223..06dbd60 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs
@@ -361,18 +361,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -399,18 +398,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -437,18 +435,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -475,18 +472,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -513,18 +509,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -551,18 +546,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -589,18 +583,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -627,18 +620,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -665,18 +657,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -703,18 +694,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -741,18 +731,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -779,18 +768,17 @@ partial void ProcessGenaiRemoveObjectResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -824,17 +812,15 @@ partial void ProcessGenaiRemoveObjectResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -871,17 +857,15 @@ partial void ProcessGenaiRemoveObjectResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs
index acb6b9c..4e45712 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs
@@ -367,18 +367,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -405,18 +404,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -443,18 +441,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -481,18 +478,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -519,18 +515,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -557,18 +552,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -595,18 +589,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -633,18 +626,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -671,18 +663,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -709,18 +700,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -747,18 +737,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -785,18 +774,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -830,17 +818,15 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -877,17 +863,15 @@ partial void ProcessGenaiSmartBackgroundResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs
index 46fce9a..75b3d42 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs
@@ -351,18 +351,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -389,18 +388,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -427,18 +425,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -465,18 +462,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -503,18 +499,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -541,18 +536,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -579,18 +573,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -617,18 +610,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -655,18 +647,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -693,18 +684,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -731,18 +721,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -769,18 +758,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -814,17 +802,15 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -861,17 +847,15 @@ partial void ProcessGenaiText2audioGetresultResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs
index 28912ea..ca3b5f8 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs
@@ -360,18 +360,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -398,18 +397,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -436,18 +434,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -474,18 +471,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -512,18 +508,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -550,18 +545,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -588,18 +582,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -626,18 +619,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -664,18 +656,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -702,18 +693,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -740,18 +730,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -778,18 +767,17 @@ partial void ProcessGenaiText2soundResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -823,17 +811,15 @@ partial void ProcessGenaiText2soundResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -870,17 +856,15 @@ partial void ProcessGenaiText2soundResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs
index 640e999..a08e6f6 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs
@@ -360,18 +360,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -398,18 +397,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payment Required
if ((int)__response.StatusCode == 402)
@@ -436,18 +434,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_402 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_402 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_402,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_402,
- ResponseObject = __value_402,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_402,
+ responseObject: __value_402,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -474,18 +471,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_403 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -512,18 +508,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_404 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Method Not Allowed
if ((int)__response.StatusCode == 405)
@@ -550,18 +545,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_405 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_405 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_405,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_405,
- ResponseObject = __value_405,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_405,
+ responseObject: __value_405,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Entity Too Large
if ((int)__response.StatusCode == 413)
@@ -588,18 +582,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_413 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_413,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_413,
- ResponseObject = __value_413,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unsupported Media Type
if ((int)__response.StatusCode == 415)
@@ -626,18 +619,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_415 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_415 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_415,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_415,
- ResponseObject = __value_415,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_415,
+ responseObject: __value_415,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -664,18 +656,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_429 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Request Header Fields Too Large
if ((int)__response.StatusCode == 431)
@@ -702,18 +693,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_431 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_431 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_431,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_431,
- ResponseObject = __value_431,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_431,
+ responseObject: __value_431,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -740,18 +730,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_500 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable
if ((int)__response.StatusCode == 503)
@@ -778,18 +767,17 @@ partial void ProcessGenaiText2speechResponseContent(
__exception_503 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -823,17 +811,15 @@ partial void ProcessGenaiText2speechResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -870,17 +856,15 @@ partial void ProcessGenaiText2speechResponseContent(
{
}
- throw new global::Picsart.ApiException(
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs
index a10f7d6..415a211 100644
--- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs
+++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs
@@ -359,18 +359,17 @@ partial void ProcessGenaiGenerateLogoResponseContent(
__exception_400 = __ex;
}
- throw new global::Picsart.ApiException(
+
+ throw global::Picsart.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -397,18 +396,17 @@ partial void ProcessGenaiGenerateLogoResponseContent(
__exception_401 = __ex;
}
- throw new global::Picsart.ApiException