From c137dc9459a620663e7a4d373577c1ddf766892f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 May 2026 04:11:09 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/OpenRouter.Exceptions.g.cs | 134 +++++++++ ...ackageAnalyticsClient.GetUserActivity.g.cs | 99 +++---- ...nthropicMessagesClient.CreateMessages.g.cs | 129 ++++---- ...er.SubpackageApiKeysClient.CreateKeys.g.cs | 99 +++---- ...er.SubpackageApiKeysClient.DeleteKeys.g.cs | 84 +++--- ...SubpackageApiKeysClient.GetCurrentKey.g.cs | 54 ++-- ...Router.SubpackageApiKeysClient.GetKey.g.cs | 84 +++--- ...enRouter.SubpackageApiKeysClient.List.g.cs | 69 ++--- ...er.SubpackageApiKeysClient.UpdateKeys.g.cs | 99 +++---- ...geBetaResponsesClient.CreateResponses.g.cs | 204 ++++++------- ...er.SubpackageByokClient.CreateByokKey.g.cs | 84 +++--- ...er.SubpackageByokClient.DeleteByokKey.g.cs | 69 ++--- ...outer.SubpackageByokClient.GetByokKey.g.cs | 69 ++--- ...ter.SubpackageByokClient.ListByokKeys.g.cs | 54 ++-- ...er.SubpackageByokClient.UpdateByokKey.g.cs | 84 +++--- ...eChatClient.SendChatCompletionRequest.g.cs | 204 ++++++------- ...er.SubpackageCreditsClient.GetCredits.g.cs | 69 ++--- ...kageEmbeddingsClient.CreateEmbeddings.g.cs | 144 +++++---- ...EmbeddingsClient.ListEmbeddingsModels.g.cs | 54 ++-- ...bpackageEndpointsClient.ListEndpoints.g.cs | 54 ++-- ...ckageEndpointsClient.ListEndpointsZdr.g.cs | 39 ++- ...ackageGenerationsClient.GetGeneration.g.cs | 114 ++++---- ...nerationsClient.ListGenerationContent.g.cs | 114 ++++---- ...railsClient.BulkAssignKeysToGuardrail.g.cs | 84 +++--- ...lsClient.BulkAssignMembersToGuardrail.g.cs | 84 +++--- ...sClient.BulkUnassignKeysFromGuardrail.g.cs | 84 +++--- ...ient.BulkUnassignMembersFromGuardrail.g.cs | 84 +++--- ...ckageGuardrailsClient.CreateGuardrail.g.cs | 84 +++--- ...ckageGuardrailsClient.DeleteGuardrail.g.cs | 69 ++--- ...bpackageGuardrailsClient.GetGuardrail.g.cs | 69 ++--- ...ilsClient.ListGuardrailKeyAssignments.g.cs | 69 ++--- ...Client.ListGuardrailMemberAssignments.g.cs | 69 ++--- ...ackageGuardrailsClient.ListGuardrails.g.cs | 54 ++-- ...geGuardrailsClient.ListKeyAssignments.g.cs | 54 ++-- ...uardrailsClient.ListMemberAssignments.g.cs | 54 ++-- ...ckageGuardrailsClient.UpdateGuardrail.g.cs | 84 +++--- ...uter.SubpackageModelsClient.GetModels.g.cs | 54 ++-- ...ubpackageModelsClient.ListModelsCount.g.cs | 54 ++-- ...SubpackageModelsClient.ListModelsUser.g.cs | 69 ++--- ...packageOAuthClient.CreateAuthKeysCode.g.cs | 84 +++--- ...OAuthClient.ExchangeAuthCodeForApiKey.g.cs | 69 ++--- ...Client.CreateObservabilityDestination.g.cs | 99 +++---- ...Client.DeleteObservabilityDestination.g.cs | 69 ++--- ...ityClient.GetObservabilityDestination.g.cs | 69 ++--- ...yClient.ListObservabilityDestinations.g.cs | 54 ++-- ...Client.UpdateObservabilityDestination.g.cs | 99 +++---- ...izationClient.ListOrganizationMembers.g.cs | 69 ++--- ...tsClient.CreatePresetsChatCompletions.g.cs | 114 ++++---- ...bpackageProvidersClient.ListProviders.g.cs | 39 ++- ...r.SubpackageRerankClient.CreateRerank.g.cs | 144 +++++---- ...geSttClient.CreateAudioTranscriptions.g.cs | 144 +++++---- ...SubpackageTtsClient.CreateAudioSpeech.g.cs | 275 ++++++++---------- ...ageVideoGenerationClient.CreateVideos.g.cs | 114 ++++---- ...ackageVideoGenerationClient.GetVideos.g.cs | 69 ++--- ...deoGenerationClient.ListVideosContent.g.cs | 185 ++++++------ ...ideoGenerationClient.ListVideosModels.g.cs | 54 ++-- ...kspacesClient.BulkAddWorkspaceMembers.g.cs | 99 +++---- ...acesClient.BulkRemoveWorkspaceMembers.g.cs | 99 +++---- ...ckageWorkspacesClient.CreateWorkspace.g.cs | 84 +++--- ...ckageWorkspacesClient.DeleteWorkspace.g.cs | 99 +++---- ...bpackageWorkspacesClient.GetWorkspace.g.cs | 69 ++--- ...ackageWorkspacesClient.ListWorkspaces.g.cs | 54 ++-- ...ckageWorkspacesClient.UpdateWorkspace.g.cs | 99 +++---- 63 files changed, 2647 insertions(+), 3032 deletions(-) diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Exceptions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Exceptions.g.cs index 2c787579..8c56a89a 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 3e861e75..72243e7b 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 24812b65..fb8a6a6a 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 3820ecf9..a6033c82 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 e0c08b54..6f762961 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 37f3a902..89f625d1 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 1c5143f0..4a6e60c8 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 f74dc78b..426e6715 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 7e955bbd..b2c91cdd 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 51df2b8e..cd52068e 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 7e5a1c52..ad512c9f 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 bcc51110..813b8ec9 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 ad5bd93a..bdbeb289 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 9683fe01..fc1cd543 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 a778bfc2..35942f22 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 be47b74a..1ab53d7f 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 99b27e8f..4f24aa68 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 dbd2d597..4c850254 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 8440e39b..b203a2b7 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 9da19426..a32acb3b 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 2b7f42d0..98cdf014 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 22bf665f..6d2ee100 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 b109294c..da2cf20f 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 b4575a90..59709975 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 cbcc5c46..cf42051f 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 4a387544..72ded9c1 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 1d1bda05..f0039305 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 dda4b558..74b2ed08 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( + + 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 ProcessCreateGuardrailResponseContent( __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 ProcessCreateGuardrailResponseContent( } 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 ProcessCreateGuardrailResponseContent( { } - 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.DeleteGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.DeleteGuardrail.g.cs index aaf4e6c4..71bbae2b 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.DeleteGuardrail.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.DeleteGuardrail.g.cs @@ -351,18 +351,17 @@ partial void ProcessDeleteGuardrailResponseContent( __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 ProcessDeleteGuardrailResponseContent( __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 ProcessDeleteGuardrailResponseContent( __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 ProcessDeleteGuardrailResponseContent( } 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 ProcessDeleteGuardrailResponseContent( { } - 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.GetGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.GetGuardrail.g.cs index 98b0d47b..e7bbd8c6 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.GetGuardrail.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.GetGuardrail.g.cs @@ -351,18 +351,17 @@ partial void ProcessGetGuardrailResponseContent( __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 ProcessGetGuardrailResponseContent( __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 ProcessGetGuardrailResponseContent( __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 ProcessGetGuardrailResponseContent( } 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 ProcessGetGuardrailResponseContent( { } - 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.ListGuardrailKeyAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrailKeyAssignments.g.cs index b1119976..35bab671 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrailKeyAssignments.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrailKeyAssignments.g.cs @@ -373,18 +373,17 @@ partial void ProcessListGuardrailKeyAssignmentsResponseContent( __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) @@ -411,18 +410,17 @@ partial void ProcessListGuardrailKeyAssignmentsResponseContent( __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) @@ -449,18 +447,17 @@ partial void ProcessListGuardrailKeyAssignmentsResponseContent( __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) @@ -494,17 +491,15 @@ partial void ProcessListGuardrailKeyAssignmentsResponseContent( } 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 @@ -541,17 +536,15 @@ partial void ProcessListGuardrailKeyAssignmentsResponseContent( { } - 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.ListGuardrailMemberAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrailMemberAssignments.g.cs index 1125907f..57c67019 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrailMemberAssignments.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrailMemberAssignments.g.cs @@ -373,18 +373,17 @@ partial void ProcessListGuardrailMemberAssignmentsResponseContent( __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) @@ -411,18 +410,17 @@ partial void ProcessListGuardrailMemberAssignmentsResponseContent( __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) @@ -449,18 +447,17 @@ partial void ProcessListGuardrailMemberAssignmentsResponseContent( __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) @@ -494,17 +491,15 @@ partial void ProcessListGuardrailMemberAssignmentsResponseContent( } 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 @@ -541,17 +536,15 @@ partial void ProcessListGuardrailMemberAssignmentsResponseContent( { } - 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.ListGuardrails.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrails.g.cs index 7da1c189..7f87dac5 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrails.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrails.g.cs @@ -374,18 +374,17 @@ partial void ProcessListGuardrailsResponseContent( __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) @@ -412,18 +411,17 @@ partial void ProcessListGuardrailsResponseContent( __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) @@ -457,17 +455,15 @@ partial void ProcessListGuardrailsResponseContent( } 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 @@ -504,17 +500,15 @@ partial void ProcessListGuardrailsResponseContent( { } - 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.ListKeyAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListKeyAssignments.g.cs index c062ff28..5a008d68 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListKeyAssignments.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListKeyAssignments.g.cs @@ -364,18 +364,17 @@ partial void ProcessListKeyAssignmentsResponseContent( __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) @@ -402,18 +401,17 @@ partial void ProcessListKeyAssignmentsResponseContent( __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) @@ -447,17 +445,15 @@ partial void ProcessListKeyAssignmentsResponseContent( } 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 @@ -494,17 +490,15 @@ partial void ProcessListKeyAssignmentsResponseContent( { } - 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.ListMemberAssignments.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListMemberAssignments.g.cs index ff4219bc..94923873 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListMemberAssignments.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListMemberAssignments.g.cs @@ -364,18 +364,17 @@ partial void ProcessListMemberAssignmentsResponseContent( __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) @@ -402,18 +401,17 @@ partial void ProcessListMemberAssignmentsResponseContent( __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) @@ -447,17 +445,15 @@ partial void ProcessListMemberAssignmentsResponseContent( } 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 @@ -494,17 +490,15 @@ partial void ProcessListMemberAssignmentsResponseContent( { } - 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.UpdateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.UpdateGuardrail.g.cs index b15fe9e9..e41e0528 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.UpdateGuardrail.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.UpdateGuardrail.g.cs @@ -371,18 +371,17 @@ partial void ProcessUpdateGuardrailResponseContent( __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 ProcessUpdateGuardrailResponseContent( __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 ProcessUpdateGuardrailResponseContent( __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 ProcessUpdateGuardrailResponseContent( __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 ProcessUpdateGuardrailResponseContent( } 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 ProcessUpdateGuardrailResponseContent( { } - 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.SubpackageModelsClient.GetModels.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.GetModels.g.cs index 456041a8..836bb178 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.GetModels.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.GetModels.g.cs @@ -396,18 +396,17 @@ partial void ProcessGetModelsResponseContent( __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) @@ -434,18 +433,17 @@ partial void ProcessGetModelsResponseContent( __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) @@ -479,17 +477,15 @@ partial void ProcessGetModelsResponseContent( } 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 @@ -526,17 +522,15 @@ partial void ProcessGetModelsResponseContent( { } - 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.SubpackageModelsClient.ListModelsCount.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.ListModelsCount.g.cs index 60c7505e..b9d66caf 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.ListModelsCount.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.ListModelsCount.g.cs @@ -352,18 +352,17 @@ partial void ProcessListModelsCountResponseContent( __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) @@ -390,18 +389,17 @@ partial void ProcessListModelsCountResponseContent( __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) @@ -435,17 +433,15 @@ partial void ProcessListModelsCountResponseContent( } 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 @@ -482,17 +478,15 @@ partial void ProcessListModelsCountResponseContent( { } - 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.SubpackageModelsClient.ListModelsUser.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.ListModelsUser.g.cs index c19bc705..b63f5662 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.ListModelsUser.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageModelsClient.ListModelsUser.g.cs @@ -342,18 +342,17 @@ partial void ProcessListModelsUserResponseContent( __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) @@ -380,18 +379,17 @@ partial void ProcessListModelsUserResponseContent( __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) @@ -418,18 +416,17 @@ partial void ProcessListModelsUserResponseContent( __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 ProcessListModelsUserResponseContent( } 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 ProcessListModelsUserResponseContent( { } - 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.SubpackageOAuthClient.CreateAuthKeysCode.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOAuthClient.CreateAuthKeysCode.g.cs index 1c1e8213..e214de63 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOAuthClient.CreateAuthKeysCode.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOAuthClient.CreateAuthKeysCode.g.cs @@ -362,18 +362,17 @@ partial void ProcessCreateAuthKeysCodeResponseContent( __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 ProcessCreateAuthKeysCodeResponseContent( __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)); } // Conflict - Resource conflict or concurrent modification if ((int)__response.StatusCode == 409) @@ -438,18 +436,17 @@ partial void ProcessCreateAuthKeysCodeResponseContent( __exception_409 = __ex; } - throw new global::OpenRouter.ApiException( + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + 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 ProcessCreateAuthKeysCodeResponseContent( __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 ProcessCreateAuthKeysCodeResponseContent( } 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 ProcessCreateAuthKeysCodeResponseContent( { } - 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.SubpackageOAuthClient.ExchangeAuthCodeForApiKey.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOAuthClient.ExchangeAuthCodeForApiKey.g.cs index 4e6912cc..64ee6caf 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOAuthClient.ExchangeAuthCodeForApiKey.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOAuthClient.ExchangeAuthCodeForApiKey.g.cs @@ -362,18 +362,17 @@ partial void ProcessExchangeAuthCodeForApiKeyResponseContent( __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)); } // Forbidden - Authentication successful but insufficient permissions if ((int)__response.StatusCode == 403) @@ -400,18 +399,17 @@ partial void ProcessExchangeAuthCodeForApiKeyResponseContent( __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) @@ -438,18 +436,17 @@ partial void ProcessExchangeAuthCodeForApiKeyResponseContent( __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) @@ -483,17 +480,15 @@ partial void ProcessExchangeAuthCodeForApiKeyResponseContent( } 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 @@ -530,17 +525,15 @@ partial void ProcessExchangeAuthCodeForApiKeyResponseContent( { } - 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.SubpackageObservabilityClient.CreateObservabilityDestination.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.CreateObservabilityDestination.g.cs index 52b40982..60ac7657 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.CreateObservabilityDestination.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.CreateObservabilityDestination.g.cs @@ -362,18 +362,17 @@ partial void ProcessCreateObservabilityDestinationResponseContent( __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 ProcessCreateObservabilityDestinationResponseContent( __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 ProcessCreateObservabilityDestinationResponseContent( __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)); } // Conflict - Resource conflict or concurrent modification if ((int)__response.StatusCode == 409) @@ -476,18 +473,17 @@ partial void ProcessCreateObservabilityDestinationResponseContent( __exception_409 = __ex; } - throw new global::OpenRouter.ApiException( + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + 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 ProcessCreateObservabilityDestinationResponseContent( __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 ProcessCreateObservabilityDestinationResponseContent( } 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 ProcessCreateObservabilityDestinationResponseContent( { } - 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.SubpackageObservabilityClient.DeleteObservabilityDestination.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.DeleteObservabilityDestination.g.cs index 0aab3baa..5e48ac2f 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.DeleteObservabilityDestination.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.DeleteObservabilityDestination.g.cs @@ -351,18 +351,17 @@ partial void ProcessDeleteObservabilityDestinationResponseContent( __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 ProcessDeleteObservabilityDestinationResponseContent( __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 ProcessDeleteObservabilityDestinationResponseContent( __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 ProcessDeleteObservabilityDestinationResponseContent( } 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 ProcessDeleteObservabilityDestinationResponseContent( { } - 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.SubpackageObservabilityClient.GetObservabilityDestination.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.GetObservabilityDestination.g.cs index d0421941..3246af81 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.GetObservabilityDestination.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.GetObservabilityDestination.g.cs @@ -351,18 +351,17 @@ partial void ProcessGetObservabilityDestinationResponseContent( __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 ProcessGetObservabilityDestinationResponseContent( __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 ProcessGetObservabilityDestinationResponseContent( __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 ProcessGetObservabilityDestinationResponseContent( } 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 ProcessGetObservabilityDestinationResponseContent( { } - 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.SubpackageObservabilityClient.ListObservabilityDestinations.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.ListObservabilityDestinations.g.cs index 7cf7aca9..fda02b41 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.ListObservabilityDestinations.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.ListObservabilityDestinations.g.cs @@ -374,18 +374,17 @@ partial void ProcessListObservabilityDestinationsResponseContent( __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) @@ -412,18 +411,17 @@ partial void ProcessListObservabilityDestinationsResponseContent( __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) @@ -457,17 +455,15 @@ partial void ProcessListObservabilityDestinationsResponseContent( } 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 @@ -504,17 +500,15 @@ partial void ProcessListObservabilityDestinationsResponseContent( { } - 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.SubpackageObservabilityClient.UpdateObservabilityDestination.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.UpdateObservabilityDestination.g.cs index 1685aeb3..747feaeb 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.UpdateObservabilityDestination.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageObservabilityClient.UpdateObservabilityDestination.g.cs @@ -371,18 +371,17 @@ partial void ProcessUpdateObservabilityDestinationResponseContent( __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 ProcessUpdateObservabilityDestinationResponseContent( __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 ProcessUpdateObservabilityDestinationResponseContent( __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)); } // Conflict - Resource conflict or concurrent modification if ((int)__response.StatusCode == 409) @@ -485,18 +482,17 @@ partial void ProcessUpdateObservabilityDestinationResponseContent( __exception_409 = __ex; } - throw new global::OpenRouter.ApiException( + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + 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 ProcessUpdateObservabilityDestinationResponseContent( __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 ProcessUpdateObservabilityDestinationResponseContent( } 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 ProcessUpdateObservabilityDestinationResponseContent( { } - 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.SubpackageOrganizationClient.ListOrganizationMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOrganizationClient.ListOrganizationMembers.g.cs index 1ccabe47..a40ed35f 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOrganizationClient.ListOrganizationMembers.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageOrganizationClient.ListOrganizationMembers.g.cs @@ -364,18 +364,17 @@ partial void ProcessListOrganizationMembersResponseContent( __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) @@ -402,18 +401,17 @@ partial void ProcessListOrganizationMembersResponseContent( __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) @@ -440,18 +438,17 @@ partial void ProcessListOrganizationMembersResponseContent( __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) @@ -485,17 +482,15 @@ partial void ProcessListOrganizationMembersResponseContent( } 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 @@ -532,17 +527,15 @@ partial void ProcessListOrganizationMembersResponseContent( { } - 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.SubpackagePresetsClient.CreatePresetsChatCompletions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackagePresetsClient.CreatePresetsChatCompletions.g.cs index 5eb24c78..067f2a45 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackagePresetsClient.CreatePresetsChatCompletions.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackagePresetsClient.CreatePresetsChatCompletions.g.cs @@ -371,18 +371,17 @@ partial void ProcessCreatePresetsChatCompletionsResponseContent( __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 ProcessCreatePresetsChatCompletionsResponseContent( __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) @@ -447,18 +445,17 @@ partial void ProcessCreatePresetsChatCompletionsResponseContent( __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) @@ -485,18 +482,17 @@ partial void ProcessCreatePresetsChatCompletionsResponseContent( __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)); } // Conflict - Resource conflict or concurrent modification if ((int)__response.StatusCode == 409) @@ -523,18 +519,17 @@ partial void ProcessCreatePresetsChatCompletionsResponseContent( __exception_409 = __ex; } - throw new global::OpenRouter.ApiException( + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + 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) @@ -561,18 +556,17 @@ partial void ProcessCreatePresetsChatCompletionsResponseContent( __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) @@ -606,17 +600,15 @@ partial void ProcessCreatePresetsChatCompletionsResponseContent( } 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 @@ -653,17 +645,15 @@ partial void ProcessCreatePresetsChatCompletionsResponseContent( { } - 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.SubpackageProvidersClient.ListProviders.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageProvidersClient.ListProviders.g.cs index bfbc3216..266149ec 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageProvidersClient.ListProviders.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageProvidersClient.ListProviders.g.cs @@ -340,18 +340,17 @@ partial void ProcessListProvidersResponseContent( __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 ProcessListProvidersResponseContent( } 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 ProcessListProvidersResponseContent( { } - 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.SubpackageRerankClient.CreateRerank.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageRerankClient.CreateRerank.g.cs index 05f052a4..4a0d04f5 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageRerankClient.CreateRerank.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageRerankClient.CreateRerank.g.cs @@ -362,18 +362,17 @@ partial void ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( __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 ProcessCreateRerankResponseContent( } 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 ProcessCreateRerankResponseContent( { } - 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.SubpackageSttClient.CreateAudioTranscriptions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageSttClient.CreateAudioTranscriptions.g.cs index 8ae3b0de..c2ff9ef1 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageSttClient.CreateAudioTranscriptions.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageSttClient.CreateAudioTranscriptions.g.cs @@ -362,18 +362,17 @@ partial void ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( __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 ProcessCreateAudioTranscriptionsResponseContent( } 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 ProcessCreateAudioTranscriptionsResponseContent( { } - 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.SubpackageTtsClient.CreateAudioSpeech.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageTtsClient.CreateAudioSpeech.g.cs index 9097f4ff..ef1c7deb 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageTtsClient.CreateAudioSpeech.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageTtsClient.CreateAudioSpeech.g.cs @@ -362,18 +362,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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 ProcessCreateAudioSpeechResponseContent( __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 ProcessCreateAudioSpeechResponseContent( __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 ProcessCreateAudioSpeechResponseContent( __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 ProcessCreateAudioSpeechResponseContent( __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 ProcessCreateAudioSpeechResponseContent( __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 ProcessCreateAudioSpeechResponseContent( __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 ProcessCreateAudioSpeechResponseContent( __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)); } try @@ -669,17 +661,15 @@ partial void ProcessCreateAudioSpeechResponseContent( { } - 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)); } } @@ -992,18 +982,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1030,18 +1019,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1068,18 +1056,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1106,18 +1093,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1144,18 +1130,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1182,18 +1167,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1220,18 +1204,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1258,18 +1241,17 @@ partial void ProcessCreateAudioSpeechResponseContent( __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) @@ -1297,16 +1279,15 @@ partial void ProcessCreateAudioSpeechResponseContent( } catch (global::System.Exception __ex) { - throw new global::OpenRouter.ApiException( + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, message: __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: null, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -1341,17 +1322,15 @@ partial void ProcessCreateAudioSpeechResponseContent( { } - 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.SubpackageVideoGenerationClient.CreateVideos.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.CreateVideos.g.cs index d1ffc260..f520ba5a 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.CreateVideos.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.CreateVideos.g.cs @@ -362,18 +362,17 @@ partial void ProcessCreateVideosResponseContent( __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 ProcessCreateVideosResponseContent( __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 ProcessCreateVideosResponseContent( __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 ProcessCreateVideosResponseContent( __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 ProcessCreateVideosResponseContent( __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 ProcessCreateVideosResponseContent( __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) @@ -597,17 +591,15 @@ partial void ProcessCreateVideosResponseContent( } 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 @@ -644,17 +636,15 @@ partial void ProcessCreateVideosResponseContent( { } - 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.SubpackageVideoGenerationClient.GetVideos.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.GetVideos.g.cs index 59b37a91..f54c8e4a 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.GetVideos.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.GetVideos.g.cs @@ -351,18 +351,17 @@ partial void ProcessGetVideosResponseContent( __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 ProcessGetVideosResponseContent( __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 ProcessGetVideosResponseContent( __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 ProcessGetVideosResponseContent( } 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 ProcessGetVideosResponseContent( { } - 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.SubpackageVideoGenerationClient.ListVideosContent.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.ListVideosContent.g.cs index 1352c3a9..75d2cd2b 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.ListVideosContent.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.ListVideosContent.g.cs @@ -367,18 +367,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -405,18 +404,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -443,18 +441,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -481,18 +478,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -519,18 +515,17 @@ partial void ProcessListVideosContentResponseContent( __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)); } try @@ -560,17 +555,15 @@ partial void ProcessListVideosContentResponseContent( { } - 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)); } } @@ -883,18 +876,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -921,18 +913,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -959,18 +950,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -997,18 +987,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -1035,18 +1024,17 @@ partial void ProcessListVideosContentResponseContent( __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) @@ -1074,16 +1062,15 @@ partial void ProcessListVideosContentResponseContent( } catch (global::System.Exception __ex) { - throw new global::OpenRouter.ApiException( + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, message: __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: null, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -1118,17 +1105,15 @@ partial void ProcessListVideosContentResponseContent( { } - 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.SubpackageVideoGenerationClient.ListVideosModels.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.ListVideosModels.g.cs index e37adafc..43e9b689 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.ListVideosModels.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageVideoGenerationClient.ListVideosModels.g.cs @@ -342,18 +342,17 @@ partial void ProcessListVideosModelsResponseContent( __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 ProcessListVideosModelsResponseContent( __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 ProcessListVideosModelsResponseContent( } 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 ProcessListVideosModelsResponseContent( { } - 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.SubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs index 095e05b3..6e3d5393 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs @@ -371,18 +371,17 @@ partial void ProcessBulkAddWorkspaceMembersResponseContent( __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 ProcessBulkAddWorkspaceMembersResponseContent( __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) @@ -447,18 +445,17 @@ partial void ProcessBulkAddWorkspaceMembersResponseContent( __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) @@ -485,18 +482,17 @@ partial void ProcessBulkAddWorkspaceMembersResponseContent( __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) @@ -523,18 +519,17 @@ partial void ProcessBulkAddWorkspaceMembersResponseContent( __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 ProcessBulkAddWorkspaceMembersResponseContent( } 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 ProcessBulkAddWorkspaceMembersResponseContent( { } - 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.SubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs index fd537171..a982ef18 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs @@ -371,18 +371,17 @@ partial void ProcessBulkRemoveWorkspaceMembersResponseContent( __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 ProcessBulkRemoveWorkspaceMembersResponseContent( __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) @@ -447,18 +445,17 @@ partial void ProcessBulkRemoveWorkspaceMembersResponseContent( __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) @@ -485,18 +482,17 @@ partial void ProcessBulkRemoveWorkspaceMembersResponseContent( __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) @@ -523,18 +519,17 @@ partial void ProcessBulkRemoveWorkspaceMembersResponseContent( __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 ProcessBulkRemoveWorkspaceMembersResponseContent( } 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 ProcessBulkRemoveWorkspaceMembersResponseContent( { } - 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.SubpackageWorkspacesClient.CreateWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.CreateWorkspace.g.cs index 34c9e3b8..e3aef045 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.CreateWorkspace.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.CreateWorkspace.g.cs @@ -362,18 +362,17 @@ partial void ProcessCreateWorkspaceResponseContent( __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 ProcessCreateWorkspaceResponseContent( __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 ProcessCreateWorkspaceResponseContent( __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 ProcessCreateWorkspaceResponseContent( __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 ProcessCreateWorkspaceResponseContent( } 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 ProcessCreateWorkspaceResponseContent( { } - 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.SubpackageWorkspacesClient.DeleteWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.DeleteWorkspace.g.cs index f64fb3c8..c688cff6 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.DeleteWorkspace.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.DeleteWorkspace.g.cs @@ -351,18 +351,17 @@ partial void ProcessDeleteWorkspaceResponseContent( __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) @@ -389,18 +388,17 @@ partial void ProcessDeleteWorkspaceResponseContent( __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) @@ -427,18 +425,17 @@ partial void ProcessDeleteWorkspaceResponseContent( __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) @@ -465,18 +462,17 @@ partial void ProcessDeleteWorkspaceResponseContent( __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) @@ -503,18 +499,17 @@ partial void ProcessDeleteWorkspaceResponseContent( __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) @@ -548,17 +543,15 @@ partial void ProcessDeleteWorkspaceResponseContent( } 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 @@ -595,17 +588,15 @@ partial void ProcessDeleteWorkspaceResponseContent( { } - 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.SubpackageWorkspacesClient.GetWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.GetWorkspace.g.cs index a1d0ee97..3470071a 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.GetWorkspace.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.GetWorkspace.g.cs @@ -351,18 +351,17 @@ partial void ProcessGetWorkspaceResponseContent( __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 ProcessGetWorkspaceResponseContent( __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 ProcessGetWorkspaceResponseContent( __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 ProcessGetWorkspaceResponseContent( } 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 ProcessGetWorkspaceResponseContent( { } - 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.SubpackageWorkspacesClient.ListWorkspaces.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.ListWorkspaces.g.cs index 21c79623..0eb33085 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.ListWorkspaces.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.ListWorkspaces.g.cs @@ -364,18 +364,17 @@ partial void ProcessListWorkspacesResponseContent( __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) @@ -402,18 +401,17 @@ partial void ProcessListWorkspacesResponseContent( __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) @@ -447,17 +445,15 @@ partial void ProcessListWorkspacesResponseContent( } 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 @@ -494,17 +490,15 @@ partial void ProcessListWorkspacesResponseContent( { } - 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.SubpackageWorkspacesClient.UpdateWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.UpdateWorkspace.g.cs index 28c2fc4e..454be5cc 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.UpdateWorkspace.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.UpdateWorkspace.g.cs @@ -371,18 +371,17 @@ partial void ProcessUpdateWorkspaceResponseContent( __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 ProcessUpdateWorkspaceResponseContent( __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) @@ -447,18 +445,17 @@ partial void ProcessUpdateWorkspaceResponseContent( __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) @@ -485,18 +482,17 @@ partial void ProcessUpdateWorkspaceResponseContent( __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) @@ -523,18 +519,17 @@ partial void ProcessUpdateWorkspaceResponseContent( __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 ProcessUpdateWorkspaceResponseContent( } 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 ProcessUpdateWorkspaceResponseContent( { } - 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)); } }