diff --git a/src/libs/Predibase/Generated/Predibase.AdaptersClient.CancelAdapter.g.cs b/src/libs/Predibase/Generated/Predibase.AdaptersClient.CancelAdapter.g.cs
index 51b74e5..1791d8b 100644
--- a/src/libs/Predibase/Generated/Predibase.AdaptersClient.CancelAdapter.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.AdaptersClient.CancelAdapter.g.cs
@@ -353,17 +353,15 @@ await CancelAdapterAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -391,17 +389,15 @@ await CancelAdapterAsResponseAsync(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.AdaptersClient.DeleteAdapter.g.cs b/src/libs/Predibase/Generated/Predibase.AdaptersClient.DeleteAdapter.g.cs
index e4c1a58..9891712 100644
--- a/src/libs/Predibase/Generated/Predibase.AdaptersClient.DeleteAdapter.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.AdaptersClient.DeleteAdapter.g.cs
@@ -353,17 +353,15 @@ await DeleteAdapterAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -391,17 +389,15 @@ await DeleteAdapterAsResponseAsync(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.AdaptersClient.GetAdapter.g.cs b/src/libs/Predibase/Generated/Predibase.AdaptersClient.GetAdapter.g.cs
index fbd9001..433cff6 100644
--- a/src/libs/Predibase/Generated/Predibase.AdaptersClient.GetAdapter.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.AdaptersClient.GetAdapter.g.cs
@@ -367,17 +367,15 @@ partial void ProcessGetAdapterResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -414,17 +412,15 @@ partial void ProcessGetAdapterResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.AdaptersClient.ListAdapters.g.cs b/src/libs/Predibase/Generated/Predibase.AdaptersClient.ListAdapters.g.cs
index 1c49891..71e9881 100644
--- a/src/libs/Predibase/Generated/Predibase.AdaptersClient.ListAdapters.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.AdaptersClient.ListAdapters.g.cs
@@ -358,17 +358,15 @@ partial void ProcessListAdaptersResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -405,17 +403,15 @@ partial void ProcessListAdaptersResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DatasetsClient.DeleteDataset.g.cs b/src/libs/Predibase/Generated/Predibase.DatasetsClient.DeleteDataset.g.cs
index 5984b3b..5ed1ceb 100644
--- a/src/libs/Predibase/Generated/Predibase.DatasetsClient.DeleteDataset.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DatasetsClient.DeleteDataset.g.cs
@@ -344,17 +344,15 @@ await DeleteDatasetAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -382,17 +380,15 @@ await DeleteDatasetAsResponseAsync(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DatasetsClient.GetDataset.g.cs b/src/libs/Predibase/Generated/Predibase.DatasetsClient.GetDataset.g.cs
index 376f96f..d7cc1df 100644
--- a/src/libs/Predibase/Generated/Predibase.DatasetsClient.GetDataset.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DatasetsClient.GetDataset.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetDatasetResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -405,17 +403,15 @@ partial void ProcessGetDatasetResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DatasetsClient.ListDatasets.g.cs b/src/libs/Predibase/Generated/Predibase.DatasetsClient.ListDatasets.g.cs
index a749b6d..d7c9065 100644
--- a/src/libs/Predibase/Generated/Predibase.DatasetsClient.ListDatasets.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DatasetsClient.ListDatasets.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListDatasetsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListDatasetsResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DeploymentsClient.CreateDeployment.g.cs b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.CreateDeployment.g.cs
index 4bbdb0c..7da479a 100644
--- a/src/libs/Predibase/Generated/Predibase.DeploymentsClient.CreateDeployment.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.CreateDeployment.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreateDeploymentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -416,17 +414,15 @@ partial void ProcessCreateDeploymentResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DeploymentsClient.DeleteDeployment.g.cs b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.DeleteDeployment.g.cs
index b83ef54..1ecb641 100644
--- a/src/libs/Predibase/Generated/Predibase.DeploymentsClient.DeleteDeployment.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.DeleteDeployment.g.cs
@@ -344,17 +344,15 @@ await DeleteDeploymentAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -382,17 +380,15 @@ await DeleteDeploymentAsResponseAsync(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DeploymentsClient.GetDeployment.g.cs b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.GetDeployment.g.cs
index 4520388..ff444aa 100644
--- a/src/libs/Predibase/Generated/Predibase.DeploymentsClient.GetDeployment.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.GetDeployment.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetDeploymentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -405,17 +403,15 @@ partial void ProcessGetDeploymentResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DeploymentsClient.ListDeployments.g.cs b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.ListDeployments.g.cs
index 26b669d..0e0d3ba 100644
--- a/src/libs/Predibase/Generated/Predibase.DeploymentsClient.ListDeployments.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.ListDeployments.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListDeploymentsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListDeploymentsResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.DeploymentsClient.UpdateDeployment.g.cs b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.UpdateDeployment.g.cs
index 96b74b0..1a90b08 100644
--- a/src/libs/Predibase/Generated/Predibase.DeploymentsClient.UpdateDeployment.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.DeploymentsClient.UpdateDeployment.g.cs
@@ -378,17 +378,15 @@ partial void ProcessUpdateDeploymentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -425,17 +423,15 @@ partial void ProcessUpdateDeploymentResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.Exceptions.g.cs b/src/libs/Predibase/Generated/Predibase.Exceptions.g.cs
index 7bd7cdd..514da6c 100644
--- a/src/libs/Predibase/Generated/Predibase.Exceptions.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.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::Predibase.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::Predibase.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body and headers populated.
+ ///
+ public static global::Predibase.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException,
+ string? responseBody,
+ global::System.Collections.Generic.Dictionary>? responseHeaders)
+ {
+ var exception = global::Predibase.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::Predibase.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::Predibase.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body, object, and headers populated.
+ ///
+ public static global::Predibase.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::Predibase.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/Predibase/Generated/Predibase.FineTuningClient.CancelFinetuningJob.g.cs b/src/libs/Predibase/Generated/Predibase.FineTuningClient.CancelFinetuningJob.g.cs
index 640eff2..e39ea9b 100644
--- a/src/libs/Predibase/Generated/Predibase.FineTuningClient.CancelFinetuningJob.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.FineTuningClient.CancelFinetuningJob.g.cs
@@ -344,17 +344,15 @@ await CancelFinetuningJobAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -382,17 +380,15 @@ await CancelFinetuningJobAsResponseAsync(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.FineTuningClient.CreateFinetuningJob.g.cs b/src/libs/Predibase/Generated/Predibase.FineTuningClient.CreateFinetuningJob.g.cs
index 302ee7f..7173c8a 100644
--- a/src/libs/Predibase/Generated/Predibase.FineTuningClient.CreateFinetuningJob.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.FineTuningClient.CreateFinetuningJob.g.cs
@@ -373,17 +373,15 @@ partial void ProcessCreateFinetuningJobResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 +418,15 @@ partial void ProcessCreateFinetuningJobResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.FineTuningClient.GetFinetuningJob.g.cs b/src/libs/Predibase/Generated/Predibase.FineTuningClient.GetFinetuningJob.g.cs
index c50f41d..f8734d4 100644
--- a/src/libs/Predibase/Generated/Predibase.FineTuningClient.GetFinetuningJob.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.FineTuningClient.GetFinetuningJob.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetFinetuningJobResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -405,17 +403,15 @@ partial void ProcessGetFinetuningJobResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.FineTuningClient.ListFinetuningJobs.g.cs b/src/libs/Predibase/Generated/Predibase.FineTuningClient.ListFinetuningJobs.g.cs
index f2c23fc..3edf7ea 100644
--- a/src/libs/Predibase/Generated/Predibase.FineTuningClient.ListFinetuningJobs.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.FineTuningClient.ListFinetuningJobs.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListFinetuningJobsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListFinetuningJobsResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.InferenceClient.ChatCompletion.g.cs b/src/libs/Predibase/Generated/Predibase.InferenceClient.ChatCompletion.g.cs
index 80d29ec..9f7e585 100644
--- a/src/libs/Predibase/Generated/Predibase.InferenceClient.ChatCompletion.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.InferenceClient.ChatCompletion.g.cs
@@ -373,18 +373,17 @@ partial void ProcessChatCompletionResponseContent(
__exception_422 = __ex;
}
- throw new global::Predibase.ApiException(
+
+ throw global::Predibase.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));
}
// Model is overloaded.
if ((int)__response.StatusCode == 429)
@@ -411,18 +410,17 @@ partial void ProcessChatCompletionResponseContent(
__exception_429 = __ex;
}
- throw new global::Predibase.ApiException(
+
+ throw global::Predibase.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));
}
if (__effectiveReadResponseAsString)
@@ -456,17 +454,15 @@ partial void ProcessChatCompletionResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -503,17 +499,15 @@ partial void ProcessChatCompletionResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.InferenceClient.Classify.g.cs b/src/libs/Predibase/Generated/Predibase.InferenceClient.Classify.g.cs
index 7c3b565..ca6690c 100644
--- a/src/libs/Predibase/Generated/Predibase.InferenceClient.Classify.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.InferenceClient.Classify.g.cs
@@ -371,18 +371,17 @@ partial void ProcessClassifyResponseContent(
__exception_422 = __ex;
}
- throw new global::Predibase.ApiException(
+
+ throw global::Predibase.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)
@@ -416,17 +415,15 @@ partial void ProcessClassifyResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -463,17 +460,15 @@ partial void ProcessClassifyResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.InferenceClient.Completion.g.cs b/src/libs/Predibase/Generated/Predibase.InferenceClient.Completion.g.cs
index 24c0092..ec34503 100644
--- a/src/libs/Predibase/Generated/Predibase.InferenceClient.Completion.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.InferenceClient.Completion.g.cs
@@ -371,18 +371,17 @@ partial void ProcessCompletionResponseContent(
__exception_422 = __ex;
}
- throw new global::Predibase.ApiException(
+
+ throw global::Predibase.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));
}
// Model is overloaded.
if ((int)__response.StatusCode == 429)
@@ -409,18 +408,17 @@ partial void ProcessCompletionResponseContent(
__exception_429 = __ex;
}
- throw new global::Predibase.ApiException(
+
+ throw global::Predibase.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));
}
if (__effectiveReadResponseAsString)
@@ -454,17 +452,15 @@ partial void ProcessCompletionResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -501,17 +497,15 @@ partial void ProcessCompletionResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.InferenceClient.Generate.g.cs b/src/libs/Predibase/Generated/Predibase.InferenceClient.Generate.g.cs
index 4ffdc93..6204382 100644
--- a/src/libs/Predibase/Generated/Predibase.InferenceClient.Generate.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.InferenceClient.Generate.g.cs
@@ -373,18 +373,17 @@ partial void ProcessGenerateResponseContent(
__exception_422 = __ex;
}
- throw new global::Predibase.ApiException(
+
+ throw global::Predibase.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));
}
// Model is overloaded.
if ((int)__response.StatusCode == 429)
@@ -411,18 +410,17 @@ partial void ProcessGenerateResponseContent(
__exception_429 = __ex;
}
- throw new global::Predibase.ApiException(
+
+ throw global::Predibase.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));
}
if (__effectiveReadResponseAsString)
@@ -456,17 +454,15 @@ partial void ProcessGenerateResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -503,17 +499,15 @@ partial void ProcessGenerateResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.InferenceClient.GetDeploymentHealth.g.cs b/src/libs/Predibase/Generated/Predibase.InferenceClient.GetDeploymentHealth.g.cs
index a687460..70a8606 100644
--- a/src/libs/Predibase/Generated/Predibase.InferenceClient.GetDeploymentHealth.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.InferenceClient.GetDeploymentHealth.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetDeploymentHealthResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -405,17 +403,15 @@ partial void ProcessGetDeploymentHealthResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.InferenceClient.GetDeploymentInfo.g.cs b/src/libs/Predibase/Generated/Predibase.InferenceClient.GetDeploymentInfo.g.cs
index a48832d..192a537 100644
--- a/src/libs/Predibase/Generated/Predibase.InferenceClient.GetDeploymentInfo.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.InferenceClient.GetDeploymentInfo.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetDeploymentInfoResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -405,17 +403,15 @@ partial void ProcessGetDeploymentInfoResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.RepositoriesClient.CreateRepository.g.cs b/src/libs/Predibase/Generated/Predibase.RepositoriesClient.CreateRepository.g.cs
index d09821f..a1c91b3 100644
--- a/src/libs/Predibase/Generated/Predibase.RepositoriesClient.CreateRepository.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.RepositoriesClient.CreateRepository.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreateRepositoryResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -416,17 +414,15 @@ partial void ProcessCreateRepositoryResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.RepositoriesClient.GetRepository.g.cs b/src/libs/Predibase/Generated/Predibase.RepositoriesClient.GetRepository.g.cs
index 6100620..027f332 100644
--- a/src/libs/Predibase/Generated/Predibase.RepositoriesClient.GetRepository.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.RepositoriesClient.GetRepository.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetRepositoryResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -405,17 +403,15 @@ partial void ProcessGetRepositoryResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Predibase/Generated/Predibase.RepositoriesClient.ListRepositories.g.cs b/src/libs/Predibase/Generated/Predibase.RepositoriesClient.ListRepositories.g.cs
index e81ec1e..9984634 100644
--- a/src/libs/Predibase/Generated/Predibase.RepositoriesClient.ListRepositories.g.cs
+++ b/src/libs/Predibase/Generated/Predibase.RepositoriesClient.ListRepositories.g.cs
@@ -365,17 +365,15 @@ partial void ProcessListRepositoriesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -412,17 +410,15 @@ partial void ProcessListRepositoriesResponseContent(
{
}
- throw new global::Predibase.ApiException(
+ throw global::Predibase.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}