diff --git a/src/libs/Nixtla/Generated/Nixtla.Exceptions.g.cs b/src/libs/Nixtla/Generated/Nixtla.Exceptions.g.cs index 6a07af3..85b7d85 100644 --- a/src/libs/Nixtla/Generated/Nixtla.Exceptions.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.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::Nixtla.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Nixtla.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::Nixtla.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Nixtla.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::Nixtla.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Nixtla.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::Nixtla.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::Nixtla.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/Nixtla/Generated/Nixtla.ExcludedClient.GetModelParamsModelParamsGet.g.cs b/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.GetModelParamsModelParamsGet.g.cs index 0a2e7bc..d43fcac 100644 --- a/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.GetModelParamsModelParamsGet.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.GetModelParamsModelParamsGet.g.cs @@ -362,18 +362,17 @@ partial void ProcessGetModelParamsModelParamsGetResponseContent( __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -405,17 +404,15 @@ partial void ProcessGetModelParamsModelParamsGetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.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 @@ -450,17 +447,15 @@ partial void ProcessGetModelParamsModelParamsGetResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.ExcludedClient.HealthHealthGet.g.cs b/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.HealthHealthGet.g.cs index fcb7329..23a9dfd 100644 --- a/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.HealthHealthGet.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.HealthHealthGet.g.cs @@ -349,17 +349,15 @@ partial void ProcessHealthHealthGetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.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 @@ -394,17 +392,15 @@ partial void ProcessHealthHealthGetResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.ExcludedClient.ModelParams.g.cs b/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.ModelParams.g.cs index 9434b8a..2ef8424 100644 --- a/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.ModelParams.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.ExcludedClient.ModelParams.g.cs @@ -362,18 +362,17 @@ partial void ProcessModelParamsResponseContent( __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -405,17 +404,15 @@ partial void ProcessModelParamsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.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 @@ -450,17 +447,15 @@ partial void ProcessModelParamsResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2AnomalyDetection.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2AnomalyDetection.g.cs index d30cd4a..c98a0f9 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2AnomalyDetection.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2AnomalyDetection.g.cs @@ -362,18 +362,17 @@ partial void ProcessV2AnomalyDetectionResponseContent( __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -407,17 +406,15 @@ partial void ProcessV2AnomalyDetectionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -454,17 +451,15 @@ partial void ProcessV2AnomalyDetectionResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2CrossValidation.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2CrossValidation.g.cs index 0045832..2e2641b 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2CrossValidation.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2CrossValidation.g.cs @@ -362,18 +362,17 @@ partial void ProcessV2CrossValidationResponseContent( __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -407,17 +406,15 @@ partial void ProcessV2CrossValidationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -454,17 +451,15 @@ partial void ProcessV2CrossValidationResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2Finetune.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2Finetune.g.cs index af5df37..0d247c3 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2Finetune.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2Finetune.g.cs @@ -362,18 +362,17 @@ partial void ProcessV2FinetuneResponseContent( __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -407,17 +406,15 @@ partial void ProcessV2FinetuneResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -454,17 +451,15 @@ partial void ProcessV2FinetuneResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelV2FinetunedModelsFinetunedModelIdGet.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelV2FinetunedModelsFinetunedModelIdGet.g.cs index b6d157d..22bf4ef 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelV2FinetunedModelsFinetunedModelIdGet.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelV2FinetunedModelsFinetunedModelIdGet.g.cs @@ -351,18 +351,17 @@ partial void ProcessV2FinetunedModelV2FinetunedModelsFinetunedModelIdGetResponse __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -396,17 +395,15 @@ partial void ProcessV2FinetunedModelV2FinetunedModelsFinetunedModelIdGetResponse } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.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 @@ -443,17 +440,15 @@ partial void ProcessV2FinetunedModelV2FinetunedModelsFinetunedModelIdGetResponse { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsDeleteV2FinetunedModelsFinetunedModelIdDelete.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsDeleteV2FinetunedModelsFinetunedModelIdDelete.g.cs index f2a3b8b..445599b 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsDeleteV2FinetunedModelsFinetunedModelIdDelete.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsDeleteV2FinetunedModelsFinetunedModelIdDelete.g.cs @@ -344,18 +344,17 @@ await V2FinetunedModelsDeleteV2FinetunedModelsFinetunedModelIdDeleteAsResponseAs __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -382,17 +381,15 @@ await V2FinetunedModelsDeleteV2FinetunedModelsFinetunedModelIdDeleteAsResponseAs } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.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 @@ -420,17 +417,15 @@ await V2FinetunedModelsDeleteV2FinetunedModelsFinetunedModelIdDeleteAsResponseAs { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsV2FinetunedModelsGet.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsV2FinetunedModelsGet.g.cs index 5db13c2..2a38bb2 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsV2FinetunedModelsGet.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2FinetunedModelsV2FinetunedModelsGet.g.cs @@ -349,17 +349,15 @@ partial void ProcessV2FinetunedModelsV2FinetunedModelsGetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.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 @@ -396,17 +394,15 @@ partial void ProcessV2FinetunedModelsV2FinetunedModelsGetResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2Forecast.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2Forecast.g.cs index 4871c9a..56af9e5 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2Forecast.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2Forecast.g.cs @@ -362,18 +362,17 @@ partial void ProcessV2ForecastResponseContent( __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -407,17 +406,15 @@ partial void ProcessV2ForecastResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -454,17 +451,15 @@ partial void ProcessV2ForecastResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.V2OnlineAnomalyDetection.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2OnlineAnomalyDetection.g.cs index 4a1474b..f9385f1 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2OnlineAnomalyDetection.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.V2OnlineAnomalyDetection.g.cs @@ -362,18 +362,17 @@ partial void ProcessV2OnlineAnomalyDetectionResponseContent( __exception_422 = __ex; } - throw new global::Nixtla.ApiException( + + throw global::Nixtla.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)); } if (__effectiveReadResponseAsString) @@ -407,17 +406,15 @@ partial void ProcessV2OnlineAnomalyDetectionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -454,17 +451,15 @@ partial void ProcessV2OnlineAnomalyDetectionResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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/Nixtla/Generated/Nixtla.NixtlaClient.ValidateApiKeyValidateApiKeyGet.g.cs b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.ValidateApiKeyValidateApiKeyGet.g.cs index f6175bd..138c1ac 100644 --- a/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.ValidateApiKeyValidateApiKeyGet.g.cs +++ b/src/libs/Nixtla/Generated/Nixtla.NixtlaClient.ValidateApiKeyValidateApiKeyGet.g.cs @@ -345,17 +345,15 @@ partial void ProcessValidateApiKeyValidateApiKeyGetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Nixtla.ApiException( + throw global::Nixtla.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 @@ -390,17 +388,15 @@ partial void ProcessValidateApiKeyValidateApiKeyGetResponseContent( { } - throw new global::Nixtla.ApiException( + throw global::Nixtla.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)); } }