diff --git a/src/libs/ZAI/Generated/ZAI.Exceptions.g.cs b/src/libs/ZAI/Generated/ZAI.Exceptions.g.cs
index bd4a5c5..5f419a7 100644
--- a/src/libs/ZAI/Generated/ZAI.Exceptions.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.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::ZAI.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::ZAI.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body and headers populated.
+ ///
+ public static global::ZAI.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException,
+ string? responseBody,
+ global::System.Collections.Generic.Dictionary>? responseHeaders)
+ {
+ var exception = global::ZAI.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::ZAI.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::ZAI.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body, object, and headers populated.
+ ///
+ public static global::ZAI.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::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreateAgents.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgents.g.cs
index 27dbd85..9c32adf 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgents.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgents.g.cs
@@ -385,18 +385,17 @@ partial void ProcessCreateAgentsResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException?>(
+
+ throw global::ZAI.ApiException?>.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -430,17 +429,15 @@ partial void ProcessCreateAgentsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -477,17 +474,15 @@ partial void ProcessCreateAgentsResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreateAgentsAsyncResult.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgentsAsyncResult.g.cs
index ad47bed..f9ac880 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgentsAsyncResult.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgentsAsyncResult.g.cs
@@ -383,18 +383,17 @@ partial void ProcessCreateAgentsAsyncResultResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -428,17 +427,15 @@ partial void ProcessCreateAgentsAsyncResultResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -475,17 +472,15 @@ partial void ProcessCreateAgentsAsyncResultResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreateAgentsConversation.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgentsConversation.g.cs
index f237527..3359a0d 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgentsConversation.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreateAgentsConversation.g.cs
@@ -383,18 +383,17 @@ partial void ProcessCreateAgentsConversationResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -428,17 +427,15 @@ partial void ProcessCreateAgentsConversationResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -475,17 +472,15 @@ partial void ProcessCreateAgentsConversationResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AsyncImagesGenerations.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AsyncImagesGenerations.g.cs
index d405449..b76a40e 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AsyncImagesGenerations.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AsyncImagesGenerations.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreatePaasV4AsyncImagesGenerationsResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -407,17 +406,15 @@ partial void ProcessCreatePaasV4AsyncImagesGenerationsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -454,17 +451,15 @@ partial void ProcessCreatePaasV4AsyncImagesGenerationsResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptions.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptions.g.cs
index eda1575..457bca0 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptions.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptions.g.cs
@@ -467,18 +467,17 @@ request.Filename is null
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -512,17 +511,15 @@ request.Filename is null
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -559,17 +556,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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));
}
}
@@ -1076,18 +1071,17 @@ request.Filename is null
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -1117,17 +1111,15 @@ request.Filename is null
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -1160,17 +1152,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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));
}
}
@@ -1614,18 +1604,17 @@ request.Filename is null
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -1659,17 +1648,15 @@ request.Filename is null
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -1706,17 +1693,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptionsAsStream.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptionsAsStream.g.cs
index b6480cf..b35e575 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptionsAsStream.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4AudioTranscriptionsAsStream.g.cs
@@ -434,17 +434,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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));
}
using var __stream = await __response.Content.ReadAsStreamAsync(
@@ -463,16 +461,15 @@ request.Filename is null
}
var __streamedResponse = global::ZAI.AudioTranscriptionStreamResponse.FromJson(__content, JsonSerializerContext) ??
- throw new global::ZAI.ApiException(
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: $"Response deserialization failed for \"{__content}\" ",
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ innerException: null,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
yield return __streamedResponse;
}
@@ -980,17 +977,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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));
}
using var __stream = await __response.Content.ReadAsStreamAsync(
@@ -1009,16 +1004,15 @@ request.Filename is null
}
var __streamedResponse = global::ZAI.AudioTranscriptionStreamResponse.FromJson(__content, JsonSerializerContext) ??
- throw new global::ZAI.ApiException(
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: $"Response deserialization failed for \"{__content}\" ",
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ innerException: null,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
yield return __streamedResponse;
}
diff --git a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ChatCompletions.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ChatCompletions.g.cs
index e006b6b..d274466 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ChatCompletions.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ChatCompletions.g.cs
@@ -381,18 +381,17 @@ partial void ProcessCreatePaasV4ChatCompletionsResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -426,17 +425,15 @@ partial void ProcessCreatePaasV4ChatCompletionsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -473,17 +470,15 @@ partial void ProcessCreatePaasV4ChatCompletionsResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Files.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Files.g.cs
index 296625f..907c9d5 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Files.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Files.g.cs
@@ -404,18 +404,17 @@ request.Filename is null
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -449,17 +448,15 @@ request.Filename is null
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -496,17 +493,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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));
}
}
@@ -910,18 +905,17 @@ request.Filename is null
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -951,17 +945,15 @@ request.Filename is null
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -994,17 +986,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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));
}
}
@@ -1372,18 +1362,17 @@ request.Filename is null
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -1417,17 +1406,15 @@ request.Filename is null
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -1464,17 +1451,15 @@ request.Filename is null
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ImagesGenerations.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ImagesGenerations.g.cs
index 634ed8c..635a564 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ImagesGenerations.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4ImagesGenerations.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreatePaasV4ImagesGenerationsResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -407,17 +406,15 @@ partial void ProcessCreatePaasV4ImagesGenerationsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -454,17 +451,15 @@ partial void ProcessCreatePaasV4ImagesGenerationsResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4LayoutParsing.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4LayoutParsing.g.cs
index 69e28c0..00e1ccc 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4LayoutParsing.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4LayoutParsing.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreatePaasV4LayoutParsingResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -407,17 +406,15 @@ partial void ProcessCreatePaasV4LayoutParsingResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -454,17 +451,15 @@ partial void ProcessCreatePaasV4LayoutParsingResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Reader.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Reader.g.cs
index 8017d1d..be91c6b 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Reader.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Reader.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreatePaasV4ReaderResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -407,17 +406,15 @@ partial void ProcessCreatePaasV4ReaderResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -454,17 +451,15 @@ partial void ProcessCreatePaasV4ReaderResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Tokenizer.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Tokenizer.g.cs
index 0c100d9..48002b7 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Tokenizer.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4Tokenizer.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreatePaasV4TokenizerResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -407,17 +406,15 @@ partial void ProcessCreatePaasV4TokenizerResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -454,17 +451,15 @@ partial void ProcessCreatePaasV4TokenizerResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4VideosGenerations.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4VideosGenerations.g.cs
index 0fae40b..86b9ff4 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4VideosGenerations.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4VideosGenerations.g.cs
@@ -383,18 +383,17 @@ partial void ProcessCreatePaasV4VideosGenerationsResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -428,17 +427,15 @@ partial void ProcessCreatePaasV4VideosGenerationsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -475,17 +472,15 @@ partial void ProcessCreatePaasV4VideosGenerationsResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4WebSearch.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4WebSearch.g.cs
index 178adba..561f768 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4WebSearch.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.CreatePaasV4WebSearch.g.cs
@@ -383,18 +383,17 @@ partial void ProcessCreatePaasV4WebSearchResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -428,17 +427,15 @@ partial void ProcessCreatePaasV4WebSearchResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -475,17 +472,15 @@ partial void ProcessCreatePaasV4WebSearchResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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/ZAI/Generated/ZAI.ZaiClient.GetPaasV4AsyncResultById.g.cs b/src/libs/ZAI/Generated/ZAI.ZaiClient.GetPaasV4AsyncResultById.g.cs
index fe484d5..2489cd3 100644
--- a/src/libs/ZAI/Generated/ZAI.ZaiClient.GetPaasV4AsyncResultById.g.cs
+++ b/src/libs/ZAI/Generated/ZAI.ZaiClient.GetPaasV4AsyncResultById.g.cs
@@ -376,18 +376,17 @@ partial void ProcessGetPaasV4AsyncResultByIdResponseContent(
__exception_default = __ex;
}
- throw new global::ZAI.ApiException(
+
+ throw global::ZAI.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_default,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_default,
- ResponseObject = __value_default,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -421,17 +420,15 @@ partial void ProcessGetPaasV4AsyncResultByIdResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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
@@ -468,17 +465,15 @@ partial void ProcessGetPaasV4AsyncResultByIdResponseContent(
{
}
- throw new global::ZAI.ApiException(
+ throw global::ZAI.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));
}
}