diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Exceptions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Exceptions.g.cs
index 2c78757..8c56a89 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.Exceptions.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.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::OpenRouter.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::OpenRouter.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body and headers populated.
+ ///
+ public static global::OpenRouter.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException,
+ string? responseBody,
+ global::System.Collections.Generic.Dictionary>? responseHeaders)
+ {
+ var exception = global::OpenRouter.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::OpenRouter.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::OpenRouter.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body, object, and headers populated.
+ ///
+ public static global::OpenRouter.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::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageAnalyticsClient.GetUserActivity.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageAnalyticsClient.GetUserActivity.g.cs
index 3e861e7..72243e7 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageAnalyticsClient.GetUserActivity.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageAnalyticsClient.GetUserActivity.g.cs
@@ -374,18 +374,17 @@ partial void ProcessGetUserActivityResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -412,18 +411,17 @@ partial void ProcessGetUserActivityResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Forbidden - Authentication successful but insufficient permissions
if ((int)__response.StatusCode == 403)
@@ -450,18 +448,17 @@ partial void ProcessGetUserActivityResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -488,18 +485,17 @@ partial void ProcessGetUserActivityResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -526,18 +522,17 @@ partial void ProcessGetUserActivityResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -571,17 +566,15 @@ partial void ProcessGetUserActivityResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -618,17 +611,15 @@ partial void ProcessGetUserActivityResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageAnthropicMessagesClient.CreateMessages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageAnthropicMessagesClient.CreateMessages.g.cs
index 24812b6..fb8a6a6 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageAnthropicMessagesClient.CreateMessages.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageAnthropicMessagesClient.CreateMessages.g.cs
@@ -381,18 +381,17 @@ partial void ProcessCreateMessagesResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Authentication error
if ((int)__response.StatusCode == 401)
@@ -419,18 +418,17 @@ partial void ProcessCreateMessagesResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Experimental-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details.
if ((int)__response.StatusCode == 403)
@@ -457,18 +455,17 @@ partial void ProcessCreateMessagesResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 error
if ((int)__response.StatusCode == 404)
@@ -495,18 +492,17 @@ partial void ProcessCreateMessagesResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Rate limit error
if ((int)__response.StatusCode == 429)
@@ -533,18 +529,17 @@ partial void ProcessCreateMessagesResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// API error
if ((int)__response.StatusCode == 500)
@@ -571,18 +566,17 @@ partial void ProcessCreateMessagesResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Overloaded error
if ((int)__response.StatusCode == 503)
@@ -609,18 +603,17 @@ partial void ProcessCreateMessagesResponseContent(
__exception_503 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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)
@@ -654,17 +647,15 @@ partial void ProcessCreateMessagesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -701,17 +692,15 @@ partial void ProcessCreateMessagesResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.CreateKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.CreateKeys.g.cs
index 3820ecf..a6033c8 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.CreateKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.CreateKeys.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreateKeysResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -400,18 +399,17 @@ partial void ProcessCreateKeysResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Forbidden - Authentication successful but insufficient permissions
if ((int)__response.StatusCode == 403)
@@ -438,18 +436,17 @@ partial void ProcessCreateKeysResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -476,18 +473,17 @@ partial void ProcessCreateKeysResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -514,18 +510,17 @@ partial void ProcessCreateKeysResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -559,17 +554,15 @@ partial void ProcessCreateKeysResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -606,17 +599,15 @@ partial void ProcessCreateKeysResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.DeleteKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.DeleteKeys.g.cs
index e0c08b5..6f76296 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.DeleteKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.DeleteKeys.g.cs
@@ -351,18 +351,17 @@ partial void ProcessDeleteKeysResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -389,18 +388,17 @@ partial void ProcessDeleteKeysResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -427,18 +425,17 @@ partial void ProcessDeleteKeysResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -465,18 +462,17 @@ partial void ProcessDeleteKeysResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -510,17 +506,15 @@ partial void ProcessDeleteKeysResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -557,17 +551,15 @@ partial void ProcessDeleteKeysResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetCurrentKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetCurrentKey.g.cs
index 37f3a90..89f625d 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetCurrentKey.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetCurrentKey.g.cs
@@ -342,18 +342,17 @@ partial void ProcessGetCurrentKeyResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -380,18 +379,17 @@ partial void ProcessGetCurrentKeyResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -425,17 +423,15 @@ partial void ProcessGetCurrentKeyResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -472,17 +468,15 @@ partial void ProcessGetCurrentKeyResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetKey.g.cs
index 1c5143f..4a6e60c 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetKey.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.GetKey.g.cs
@@ -351,18 +351,17 @@ partial void ProcessGetKeyResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -389,18 +388,17 @@ partial void ProcessGetKeyResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -427,18 +425,17 @@ partial void ProcessGetKeyResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -465,18 +462,17 @@ partial void ProcessGetKeyResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -510,17 +506,15 @@ partial void ProcessGetKeyResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -557,17 +551,15 @@ partial void ProcessGetKeyResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.List.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.List.g.cs
index f74dc78..426e671 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.List.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.List.g.cs
@@ -374,18 +374,17 @@ partial void ProcessListResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -412,18 +411,17 @@ partial void ProcessListResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -450,18 +448,17 @@ partial void ProcessListResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -495,17 +492,15 @@ partial void ProcessListResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -542,17 +537,15 @@ partial void ProcessListResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.UpdateKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.UpdateKeys.g.cs
index 7e955bb..b2c91cd 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.UpdateKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageApiKeysClient.UpdateKeys.g.cs
@@ -371,18 +371,17 @@ partial void ProcessUpdateKeysResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -409,18 +408,17 @@ partial void ProcessUpdateKeysResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -447,18 +445,17 @@ partial void ProcessUpdateKeysResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -485,18 +482,17 @@ partial void ProcessUpdateKeysResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -523,18 +519,17 @@ partial void ProcessUpdateKeysResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -568,17 +563,15 @@ partial void ProcessUpdateKeysResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -615,17 +608,15 @@ partial void ProcessUpdateKeysResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageBetaResponsesClient.CreateResponses.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageBetaResponsesClient.CreateResponses.g.cs
index 51df2b8..cd52068 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageBetaResponsesClient.CreateResponses.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageBetaResponsesClient.CreateResponses.g.cs
@@ -381,18 +381,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -419,18 +418,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Insufficient credits or quota to complete request
if ((int)__response.StatusCode == 402)
@@ -457,18 +455,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_402 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Experimental-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details.
if ((int)__response.StatusCode == 403)
@@ -495,18 +492,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -533,18 +529,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Request Timeout - Operation exceeded time limit
if ((int)__response.StatusCode == 408)
@@ -571,18 +566,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_408 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_408 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_408,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_408,
- ResponseObject = __value_408,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_408,
+ responseObject: __value_408,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payload Too Large - Request payload exceeds size limits
if ((int)__response.StatusCode == 413)
@@ -609,18 +603,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_413 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Unprocessable Entity - Semantic validation failure
if ((int)__response.StatusCode == 422)
@@ -647,18 +640,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_422 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_422,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_422,
- ResponseObject = __value_422,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_422,
+ responseObject: __value_422,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -685,18 +677,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -723,18 +714,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Bad Gateway - Provider/upstream API failure
if ((int)__response.StatusCode == 502)
@@ -761,18 +751,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_502 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_502 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_502,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_502,
- ResponseObject = __value_502,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_502,
+ responseObject: __value_502,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable - Service temporarily unavailable
if ((int)__response.StatusCode == 503)
@@ -799,18 +788,17 @@ partial void ProcessCreateResponsesResponseContent(
__exception_503 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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)
@@ -844,17 +832,15 @@ partial void ProcessCreateResponsesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -891,17 +877,15 @@ partial void ProcessCreateResponsesResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageByokClient.CreateByokKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.CreateByokKey.g.cs
index 7e5a1c5..ad512c9 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.CreateByokKey.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.CreateByokKey.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreateByokKeyResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -400,18 +399,17 @@ partial void ProcessCreateByokKeyResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Forbidden - Authentication successful but insufficient permissions
if ((int)__response.StatusCode == 403)
@@ -438,18 +436,17 @@ partial void ProcessCreateByokKeyResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -476,18 +473,17 @@ partial void ProcessCreateByokKeyResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -521,17 +517,15 @@ partial void ProcessCreateByokKeyResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -568,17 +562,15 @@ partial void ProcessCreateByokKeyResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageByokClient.DeleteByokKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.DeleteByokKey.g.cs
index bcc5111..813b8ec 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.DeleteByokKey.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.DeleteByokKey.g.cs
@@ -351,18 +351,17 @@ partial void ProcessDeleteByokKeyResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -389,18 +388,17 @@ partial void ProcessDeleteByokKeyResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -427,18 +425,17 @@ partial void ProcessDeleteByokKeyResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -472,17 +469,15 @@ partial void ProcessDeleteByokKeyResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -519,17 +514,15 @@ partial void ProcessDeleteByokKeyResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageByokClient.GetByokKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.GetByokKey.g.cs
index ad5bd93..bdbeb28 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.GetByokKey.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.GetByokKey.g.cs
@@ -351,18 +351,17 @@ partial void ProcessGetByokKeyResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -389,18 +388,17 @@ partial void ProcessGetByokKeyResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -427,18 +425,17 @@ partial void ProcessGetByokKeyResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -472,17 +469,15 @@ partial void ProcessGetByokKeyResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -519,17 +514,15 @@ partial void ProcessGetByokKeyResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageByokClient.ListByokKeys.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.ListByokKeys.g.cs
index 9683fe0..fc1cd54 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.ListByokKeys.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.ListByokKeys.g.cs
@@ -388,18 +388,17 @@ partial void ProcessListByokKeysResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -426,18 +425,17 @@ partial void ProcessListByokKeysResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -471,17 +469,15 @@ partial void ProcessListByokKeysResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -518,17 +514,15 @@ partial void ProcessListByokKeysResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageByokClient.UpdateByokKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.UpdateByokKey.g.cs
index a778bfc..35942f2 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.UpdateByokKey.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageByokClient.UpdateByokKey.g.cs
@@ -371,18 +371,17 @@ partial void ProcessUpdateByokKeyResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -409,18 +408,17 @@ partial void ProcessUpdateByokKeyResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -447,18 +445,17 @@ partial void ProcessUpdateByokKeyResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -485,18 +482,17 @@ partial void ProcessUpdateByokKeyResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -530,17 +526,15 @@ partial void ProcessUpdateByokKeyResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -577,17 +571,15 @@ partial void ProcessUpdateByokKeyResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageChatClient.SendChatCompletionRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageChatClient.SendChatCompletionRequest.g.cs
index be47b74..1ab53d7 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageChatClient.SendChatCompletionRequest.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageChatClient.SendChatCompletionRequest.g.cs
@@ -381,18 +381,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -419,18 +418,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Insufficient credits or quota to complete request
if ((int)__response.StatusCode == 402)
@@ -457,18 +455,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_402 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Experimental-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details.
if ((int)__response.StatusCode == 403)
@@ -495,18 +492,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -533,18 +529,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Request Timeout - Operation exceeded time limit
if ((int)__response.StatusCode == 408)
@@ -571,18 +566,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_408 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_408 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_408,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_408,
- ResponseObject = __value_408,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_408,
+ responseObject: __value_408,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Payload Too Large - Request payload exceeds size limits
if ((int)__response.StatusCode == 413)
@@ -609,18 +603,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_413 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Unprocessable Entity - Semantic validation failure
if ((int)__response.StatusCode == 422)
@@ -647,18 +640,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_422 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_422,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_422,
- ResponseObject = __value_422,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_422,
+ responseObject: __value_422,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -685,18 +677,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -723,18 +714,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Bad Gateway - Provider/upstream API failure
if ((int)__response.StatusCode == 502)
@@ -761,18 +751,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_502 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_502 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_502,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_502,
- ResponseObject = __value_502,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_502,
+ responseObject: __value_502,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable - Service temporarily unavailable
if ((int)__response.StatusCode == 503)
@@ -799,18 +788,17 @@ partial void ProcessSendChatCompletionRequestResponseContent(
__exception_503 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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)
@@ -844,17 +832,15 @@ partial void ProcessSendChatCompletionRequestResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -891,17 +877,15 @@ partial void ProcessSendChatCompletionRequestResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageCreditsClient.GetCredits.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageCreditsClient.GetCredits.g.cs
index 99b27e8..4f24aa6 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageCreditsClient.GetCredits.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageCreditsClient.GetCredits.g.cs
@@ -342,18 +342,17 @@ partial void ProcessGetCreditsResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Forbidden - Authentication successful but insufficient permissions
if ((int)__response.StatusCode == 403)
@@ -380,18 +379,17 @@ partial void ProcessGetCreditsResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -418,18 +416,17 @@ partial void ProcessGetCreditsResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -463,17 +460,15 @@ partial void ProcessGetCreditsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -510,17 +505,15 @@ partial void ProcessGetCreditsResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.CreateEmbeddings.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.CreateEmbeddings.g.cs
index dbd2d59..4c85025 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.CreateEmbeddings.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.CreateEmbeddings.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -400,18 +399,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Insufficient credits or quota to complete request
if ((int)__response.StatusCode == 402)
@@ -438,18 +436,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_402 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -476,18 +473,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -514,18 +510,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -552,18 +547,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Bad Gateway - Provider/upstream API failure
if ((int)__response.StatusCode == 502)
@@ -590,18 +584,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_502 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_502 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_502,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_502,
- ResponseObject = __value_502,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_502,
+ responseObject: __value_502,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Service Unavailable - Service temporarily unavailable
if ((int)__response.StatusCode == 503)
@@ -628,18 +621,17 @@ partial void ProcessCreateEmbeddingsResponseContent(
__exception_503 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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)
@@ -673,17 +665,15 @@ partial void ProcessCreateEmbeddingsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -720,17 +710,15 @@ partial void ProcessCreateEmbeddingsResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.ListEmbeddingsModels.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.ListEmbeddingsModels.g.cs
index 8440e39..b203a2b 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.ListEmbeddingsModels.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEmbeddingsClient.ListEmbeddingsModels.g.cs
@@ -342,18 +342,17 @@ partial void ProcessListEmbeddingsModelsResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -380,18 +379,17 @@ partial void ProcessListEmbeddingsModelsResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -425,17 +423,15 @@ partial void ProcessListEmbeddingsModelsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -472,17 +468,15 @@ partial void ProcessListEmbeddingsModelsResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpoints.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpoints.g.cs
index 9da1942..a32acb3 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpoints.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpoints.g.cs
@@ -358,18 +358,17 @@ partial void ProcessListEndpointsResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -396,18 +395,17 @@ partial void ProcessListEndpointsResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -441,17 +439,15 @@ partial void ProcessListEndpointsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -488,17 +484,15 @@ partial void ProcessListEndpointsResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpointsZdr.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpointsZdr.g.cs
index 2b7f42d..98cdf01 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpointsZdr.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageEndpointsClient.ListEndpointsZdr.g.cs
@@ -340,18 +340,17 @@ partial void ProcessListEndpointsZdrResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -385,17 +384,15 @@ partial void ProcessListEndpointsZdrResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -432,17 +429,15 @@ partial void ProcessListEndpointsZdrResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.GetGeneration.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.GetGeneration.g.cs
index 22bf665..6d2ee10 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.GetGeneration.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.GetGeneration.g.cs
@@ -352,18 +352,17 @@ partial void ProcessGetGenerationResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Insufficient credits or quota to complete request
if ((int)__response.StatusCode == 402)
@@ -390,18 +389,17 @@ partial void ProcessGetGenerationResponseContent(
__exception_402 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -428,18 +426,17 @@ partial void ProcessGetGenerationResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -466,18 +463,17 @@ partial void ProcessGetGenerationResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -504,18 +500,17 @@ partial void ProcessGetGenerationResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Bad Gateway - Provider/upstream API failure
if ((int)__response.StatusCode == 502)
@@ -542,18 +537,17 @@ partial void ProcessGetGenerationResponseContent(
__exception_502 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_502 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_502,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_502,
- ResponseObject = __value_502,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_502,
+ responseObject: __value_502,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -587,17 +581,15 @@ partial void ProcessGetGenerationResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -634,17 +626,15 @@ partial void ProcessGetGenerationResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.ListGenerationContent.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.ListGenerationContent.g.cs
index b109294..da2cf20 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.ListGenerationContent.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGenerationsClient.ListGenerationContent.g.cs
@@ -352,18 +352,17 @@ partial void ProcessListGenerationContentResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Forbidden - Authentication successful but insufficient permissions
if ((int)__response.StatusCode == 403)
@@ -390,18 +389,17 @@ partial void ProcessListGenerationContentResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -428,18 +426,17 @@ partial void ProcessListGenerationContentResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Too Many Requests - Rate limit exceeded
if ((int)__response.StatusCode == 429)
@@ -466,18 +463,17 @@ partial void ProcessListGenerationContentResponseContent(
__exception_429 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -504,18 +500,17 @@ partial void ProcessListGenerationContentResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Bad Gateway - Provider/upstream API failure
if ((int)__response.StatusCode == 502)
@@ -542,18 +537,17 @@ partial void ProcessListGenerationContentResponseContent(
__exception_502 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_502 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_502,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_502,
- ResponseObject = __value_502,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_502,
+ responseObject: __value_502,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -587,17 +581,15 @@ partial void ProcessListGenerationContentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -634,17 +626,15 @@ partial void ProcessListGenerationContentResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignKeysToGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignKeysToGuardrail.g.cs
index b4575a9..5970997 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignKeysToGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignKeysToGuardrail.g.cs
@@ -371,18 +371,17 @@ partial void ProcessBulkAssignKeysToGuardrailResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -409,18 +408,17 @@ partial void ProcessBulkAssignKeysToGuardrailResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -447,18 +445,17 @@ partial void ProcessBulkAssignKeysToGuardrailResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -485,18 +482,17 @@ partial void ProcessBulkAssignKeysToGuardrailResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -530,17 +526,15 @@ partial void ProcessBulkAssignKeysToGuardrailResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -577,17 +571,15 @@ partial void ProcessBulkAssignKeysToGuardrailResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignMembersToGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignMembersToGuardrail.g.cs
index cbcc5c4..cf42051 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignMembersToGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkAssignMembersToGuardrail.g.cs
@@ -371,18 +371,17 @@ partial void ProcessBulkAssignMembersToGuardrailResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -409,18 +408,17 @@ partial void ProcessBulkAssignMembersToGuardrailResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -447,18 +445,17 @@ partial void ProcessBulkAssignMembersToGuardrailResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -485,18 +482,17 @@ partial void ProcessBulkAssignMembersToGuardrailResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -530,17 +526,15 @@ partial void ProcessBulkAssignMembersToGuardrailResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -577,17 +571,15 @@ partial void ProcessBulkAssignMembersToGuardrailResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignKeysFromGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignKeysFromGuardrail.g.cs
index 4a38754..72ded9c 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignKeysFromGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignKeysFromGuardrail.g.cs
@@ -371,18 +371,17 @@ partial void ProcessBulkUnassignKeysFromGuardrailResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -409,18 +408,17 @@ partial void ProcessBulkUnassignKeysFromGuardrailResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -447,18 +445,17 @@ partial void ProcessBulkUnassignKeysFromGuardrailResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -485,18 +482,17 @@ partial void ProcessBulkUnassignKeysFromGuardrailResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -530,17 +526,15 @@ partial void ProcessBulkUnassignKeysFromGuardrailResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -577,17 +571,15 @@ partial void ProcessBulkUnassignKeysFromGuardrailResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignMembersFromGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignMembersFromGuardrail.g.cs
index 1d1bda0..f003930 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignMembersFromGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.BulkUnassignMembersFromGuardrail.g.cs
@@ -371,18 +371,17 @@ partial void ProcessBulkUnassignMembersFromGuardrailResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -409,18 +408,17 @@ partial void ProcessBulkUnassignMembersFromGuardrailResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Not Found - Resource does not exist
if ((int)__response.StatusCode == 404)
@@ -447,18 +445,17 @@ partial void ProcessBulkUnassignMembersFromGuardrailResponseContent(
__exception_404 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Internal Server Error - Unexpected server error
if ((int)__response.StatusCode == 500)
@@ -485,18 +482,17 @@ partial void ProcessBulkUnassignMembersFromGuardrailResponseContent(
__exception_500 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
if (__effectiveReadResponseAsString)
@@ -530,17 +526,15 @@ partial void ProcessBulkUnassignMembersFromGuardrailResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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
@@ -577,17 +571,15 @@ partial void ProcessBulkUnassignMembersFromGuardrailResponseContent(
{
}
- throw new global::OpenRouter.ApiException(
+ throw global::OpenRouter.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/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs
index dda4b55..74b2ed0 100644
--- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs
+++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs
@@ -362,18 +362,17 @@ partial void ProcessCreateGuardrailResponseContent(
__exception_400 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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 - Authentication required or invalid credentials
if ((int)__response.StatusCode == 401)
@@ -400,18 +399,17 @@ partial void ProcessCreateGuardrailResponseContent(
__exception_401 = __ex;
}
- throw new global::OpenRouter.ApiException(
+
+ throw global::OpenRouter.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));
}
// Forbidden - Authentication successful but insufficient permissions
if ((int)__response.StatusCode == 403)
@@ -438,18 +436,17 @@ partial void ProcessCreateGuardrailResponseContent(
__exception_403 = __ex;
}
- throw new global::OpenRouter.ApiException