diff --git a/src/libs/Tavus/Generated/Tavus.ConversationsClient.CreateConversation.g.cs b/src/libs/Tavus/Generated/Tavus.ConversationsClient.CreateConversation.g.cs
index 7a591be..a744a0b 100644
--- a/src/libs/Tavus/Generated/Tavus.ConversationsClient.CreateConversation.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ConversationsClient.CreateConversation.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreateConversationResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessCreateConversationResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ConversationsClient.DeleteConversation.g.cs b/src/libs/Tavus/Generated/Tavus.ConversationsClient.DeleteConversation.g.cs
index cdc0997..b7fe0b6 100644
--- a/src/libs/Tavus/Generated/Tavus.ConversationsClient.DeleteConversation.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ConversationsClient.DeleteConversation.g.cs
@@ -344,17 +344,15 @@ await DeleteConversationAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeleteConversationAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ConversationsClient.EndConversation.g.cs b/src/libs/Tavus/Generated/Tavus.ConversationsClient.EndConversation.g.cs
index 94c1b47..b45638e 100644
--- a/src/libs/Tavus/Generated/Tavus.ConversationsClient.EndConversation.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ConversationsClient.EndConversation.g.cs
@@ -344,17 +344,15 @@ await EndConversationAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 EndConversationAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ConversationsClient.GetConversation.g.cs b/src/libs/Tavus/Generated/Tavus.ConversationsClient.GetConversation.g.cs
index 92e8a2c..e1560ea 100644
--- a/src/libs/Tavus/Generated/Tavus.ConversationsClient.GetConversation.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ConversationsClient.GetConversation.g.cs
@@ -370,17 +370,15 @@ partial void ProcessGetConversationResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -417,17 +415,15 @@ partial void ProcessGetConversationResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ConversationsClient.ListConversations.g.cs b/src/libs/Tavus/Generated/Tavus.ConversationsClient.ListConversations.g.cs
index f1b0d51..496e024 100644
--- a/src/libs/Tavus/Generated/Tavus.ConversationsClient.ListConversations.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ConversationsClient.ListConversations.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListConversationsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListConversationsResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.DocumentsClient.CreateDocument.g.cs b/src/libs/Tavus/Generated/Tavus.DocumentsClient.CreateDocument.g.cs
index f3036b0..47ca366 100644
--- a/src/libs/Tavus/Generated/Tavus.DocumentsClient.CreateDocument.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.DocumentsClient.CreateDocument.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreateDocumentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessCreateDocumentResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.DocumentsClient.DeleteDocument.g.cs b/src/libs/Tavus/Generated/Tavus.DocumentsClient.DeleteDocument.g.cs
index 9fb64ba..4b76e3c 100644
--- a/src/libs/Tavus/Generated/Tavus.DocumentsClient.DeleteDocument.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.DocumentsClient.DeleteDocument.g.cs
@@ -344,17 +344,15 @@ await DeleteDocumentAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeleteDocumentAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.DocumentsClient.GetDocument.g.cs b/src/libs/Tavus/Generated/Tavus.DocumentsClient.GetDocument.g.cs
index cf60a68..2d13628 100644
--- a/src/libs/Tavus/Generated/Tavus.DocumentsClient.GetDocument.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.DocumentsClient.GetDocument.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetDocumentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessGetDocumentResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.DocumentsClient.ListDocuments.g.cs b/src/libs/Tavus/Generated/Tavus.DocumentsClient.ListDocuments.g.cs
index b7246d5..8d6da58 100644
--- a/src/libs/Tavus/Generated/Tavus.DocumentsClient.ListDocuments.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.DocumentsClient.ListDocuments.g.cs
@@ -381,17 +381,15 @@ partial void ProcessListDocumentsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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
@@ -428,17 +426,15 @@ partial void ProcessListDocumentsResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.DocumentsClient.RecrawlDocument.g.cs b/src/libs/Tavus/Generated/Tavus.DocumentsClient.RecrawlDocument.g.cs
index 20e3a68..6cfe1af 100644
--- a/src/libs/Tavus/Generated/Tavus.DocumentsClient.RecrawlDocument.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.DocumentsClient.RecrawlDocument.g.cs
@@ -378,17 +378,15 @@ partial void ProcessRecrawlDocumentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessRecrawlDocumentResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.DocumentsClient.UpdateDocument.g.cs b/src/libs/Tavus/Generated/Tavus.DocumentsClient.UpdateDocument.g.cs
index 278d049..36348db 100644
--- a/src/libs/Tavus/Generated/Tavus.DocumentsClient.UpdateDocument.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.DocumentsClient.UpdateDocument.g.cs
@@ -378,17 +378,15 @@ partial void ProcessUpdateDocumentResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessUpdateDocumentResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.Exceptions.g.cs b/src/libs/Tavus/Generated/Tavus.Exceptions.g.cs
index 9e268d4..e594179 100644
--- a/src/libs/Tavus/Generated/Tavus.Exceptions.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.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::Tavus.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::Tavus.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body and headers populated.
+ ///
+ public static global::Tavus.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException,
+ string? responseBody,
+ global::System.Collections.Generic.Dictionary>? responseHeaders)
+ {
+ var exception = global::Tavus.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::Tavus.ApiException Create(
+ global::System.Net.HttpStatusCode statusCode,
+ string message,
+ global::System.Exception? innerException = null,
+ global::System.Collections.Generic.IDictionary>? responseHeaders = null)
+ {
+ return new global::Tavus.ApiException(message, innerException, statusCode);
+ }
+
+ ///
+ /// Convenience overload that constructs an with response body, object, and headers populated.
+ ///
+ public static global::Tavus.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::Tavus.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/Tavus/Generated/Tavus.GuardrailsClient.CreateGuardrails.g.cs b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.CreateGuardrails.g.cs
index 5af5a3f..6b2fbea 100644
--- a/src/libs/Tavus/Generated/Tavus.GuardrailsClient.CreateGuardrails.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.CreateGuardrails.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreateGuardrailsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessCreateGuardrailsResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.GuardrailsClient.DeleteGuardrails.g.cs b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.DeleteGuardrails.g.cs
index 9a34b24..bad6141 100644
--- a/src/libs/Tavus/Generated/Tavus.GuardrailsClient.DeleteGuardrails.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.DeleteGuardrails.g.cs
@@ -344,17 +344,15 @@ await DeleteGuardrailsAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeleteGuardrailsAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.GuardrailsClient.GetGuardrails.g.cs b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.GetGuardrails.g.cs
index 93cc4b7..58cbd48 100644
--- a/src/libs/Tavus/Generated/Tavus.GuardrailsClient.GetGuardrails.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.GetGuardrails.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetGuardrailsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessGetGuardrailsResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.GuardrailsClient.ListGuardrails.g.cs b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.ListGuardrails.g.cs
index a969146..e3b853e 100644
--- a/src/libs/Tavus/Generated/Tavus.GuardrailsClient.ListGuardrails.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.ListGuardrails.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListGuardrailsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListGuardrailsResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.GuardrailsClient.PatchGuardrails.g.cs b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.PatchGuardrails.g.cs
index 0d79d1b..faeadff 100644
--- a/src/libs/Tavus/Generated/Tavus.GuardrailsClient.PatchGuardrails.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.GuardrailsClient.PatchGuardrails.g.cs
@@ -378,17 +378,15 @@ partial void ProcessPatchGuardrailsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessPatchGuardrailsResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.MemoriesClient.DeleteMemory.g.cs b/src/libs/Tavus/Generated/Tavus.MemoriesClient.DeleteMemory.g.cs
index 6b32115..097e021 100644
--- a/src/libs/Tavus/Generated/Tavus.MemoriesClient.DeleteMemory.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.MemoriesClient.DeleteMemory.g.cs
@@ -353,17 +353,15 @@ await DeleteMemoryAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeleteMemoryAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ObjectivesClient.CreateObjectives.g.cs b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.CreateObjectives.g.cs
index 69155af..d39b73e 100644
--- a/src/libs/Tavus/Generated/Tavus.ObjectivesClient.CreateObjectives.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.CreateObjectives.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreateObjectivesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessCreateObjectivesResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ObjectivesClient.DeleteObjectives.g.cs b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.DeleteObjectives.g.cs
index e2f4909..fdaf135 100644
--- a/src/libs/Tavus/Generated/Tavus.ObjectivesClient.DeleteObjectives.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.DeleteObjectives.g.cs
@@ -344,17 +344,15 @@ await DeleteObjectivesAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeleteObjectivesAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ObjectivesClient.GetObjectives.g.cs b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.GetObjectives.g.cs
index 699ccc7..38af0e7 100644
--- a/src/libs/Tavus/Generated/Tavus.ObjectivesClient.GetObjectives.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.GetObjectives.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetObjectivesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessGetObjectivesResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ObjectivesClient.ListObjectives.g.cs b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.ListObjectives.g.cs
index c73e55f..4d8343e 100644
--- a/src/libs/Tavus/Generated/Tavus.ObjectivesClient.ListObjectives.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.ListObjectives.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListObjectivesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListObjectivesResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ObjectivesClient.PatchObjectives.g.cs b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.PatchObjectives.g.cs
index 9b3bde9..515e334 100644
--- a/src/libs/Tavus/Generated/Tavus.ObjectivesClient.PatchObjectives.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ObjectivesClient.PatchObjectives.g.cs
@@ -378,17 +378,15 @@ partial void ProcessPatchObjectivesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessPatchObjectivesResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.PersonasClient.CreatePersona.g.cs b/src/libs/Tavus/Generated/Tavus.PersonasClient.CreatePersona.g.cs
index fdcae84..a3a0f98 100644
--- a/src/libs/Tavus/Generated/Tavus.PersonasClient.CreatePersona.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.PersonasClient.CreatePersona.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreatePersonaResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessCreatePersonaResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.PersonasClient.DeletePersona.g.cs b/src/libs/Tavus/Generated/Tavus.PersonasClient.DeletePersona.g.cs
index ee5d235..b6be4f6 100644
--- a/src/libs/Tavus/Generated/Tavus.PersonasClient.DeletePersona.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.PersonasClient.DeletePersona.g.cs
@@ -344,17 +344,15 @@ await DeletePersonaAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeletePersonaAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.PersonasClient.GetPersona.g.cs b/src/libs/Tavus/Generated/Tavus.PersonasClient.GetPersona.g.cs
index 27a7225..61b6e2e 100644
--- a/src/libs/Tavus/Generated/Tavus.PersonasClient.GetPersona.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.PersonasClient.GetPersona.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetPersonaResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessGetPersonaResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.PersonasClient.ListPersonas.g.cs b/src/libs/Tavus/Generated/Tavus.PersonasClient.ListPersonas.g.cs
index cd03420..f3ddc21 100644
--- a/src/libs/Tavus/Generated/Tavus.PersonasClient.ListPersonas.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.PersonasClient.ListPersonas.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListPersonasResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListPersonasResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.PersonasClient.PatchPersona.g.cs b/src/libs/Tavus/Generated/Tavus.PersonasClient.PatchPersona.g.cs
index 71aea19..f62ce3d 100644
--- a/src/libs/Tavus/Generated/Tavus.PersonasClient.PatchPersona.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.PersonasClient.PatchPersona.g.cs
@@ -378,17 +378,15 @@ partial void ProcessPatchPersonaResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessPatchPersonaResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ReplicasClient.CreateReplica.g.cs b/src/libs/Tavus/Generated/Tavus.ReplicasClient.CreateReplica.g.cs
index 5ac7260..1be49d4 100644
--- a/src/libs/Tavus/Generated/Tavus.ReplicasClient.CreateReplica.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ReplicasClient.CreateReplica.g.cs
@@ -369,17 +369,15 @@ partial void ProcessCreateReplicaResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessCreateReplicaResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ReplicasClient.DeleteReplica.g.cs b/src/libs/Tavus/Generated/Tavus.ReplicasClient.DeleteReplica.g.cs
index f7e8fa5..5d41761 100644
--- a/src/libs/Tavus/Generated/Tavus.ReplicasClient.DeleteReplica.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ReplicasClient.DeleteReplica.g.cs
@@ -344,17 +344,15 @@ await DeleteReplicaAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeleteReplicaAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ReplicasClient.GetReplica.g.cs b/src/libs/Tavus/Generated/Tavus.ReplicasClient.GetReplica.g.cs
index f8ace36..59e5e9b 100644
--- a/src/libs/Tavus/Generated/Tavus.ReplicasClient.GetReplica.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ReplicasClient.GetReplica.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetReplicaResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessGetReplicaResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ReplicasClient.ListReplicas.g.cs b/src/libs/Tavus/Generated/Tavus.ReplicasClient.ListReplicas.g.cs
index 165fbe9..7df9fc8 100644
--- a/src/libs/Tavus/Generated/Tavus.ReplicasClient.ListReplicas.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ReplicasClient.ListReplicas.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListReplicasResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListReplicasResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.ReplicasClient.RenameReplica.g.cs b/src/libs/Tavus/Generated/Tavus.ReplicasClient.RenameReplica.g.cs
index 72efa44..2ede324 100644
--- a/src/libs/Tavus/Generated/Tavus.ReplicasClient.RenameReplica.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.ReplicasClient.RenameReplica.g.cs
@@ -378,17 +378,15 @@ partial void ProcessRenameReplicaResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessRenameReplicaResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.VideosClient.DeleteVideo.g.cs b/src/libs/Tavus/Generated/Tavus.VideosClient.DeleteVideo.g.cs
index 56f49a0..f4b8303 100644
--- a/src/libs/Tavus/Generated/Tavus.VideosClient.DeleteVideo.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.VideosClient.DeleteVideo.g.cs
@@ -344,17 +344,15 @@ await DeleteVideoAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 DeleteVideoAsResponseAsync(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.VideosClient.GenerateVideo.g.cs b/src/libs/Tavus/Generated/Tavus.VideosClient.GenerateVideo.g.cs
index b50d91f..b11dea9 100644
--- a/src/libs/Tavus/Generated/Tavus.VideosClient.GenerateVideo.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.VideosClient.GenerateVideo.g.cs
@@ -369,17 +369,15 @@ partial void ProcessGenerateVideoResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessGenerateVideoResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.VideosClient.GetVideo.g.cs b/src/libs/Tavus/Generated/Tavus.VideosClient.GetVideo.g.cs
index 7af3a84..dadaa1a 100644
--- a/src/libs/Tavus/Generated/Tavus.VideosClient.GetVideo.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.VideosClient.GetVideo.g.cs
@@ -358,17 +358,15 @@ partial void ProcessGetVideoResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessGetVideoResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.VideosClient.ListVideos.g.cs b/src/libs/Tavus/Generated/Tavus.VideosClient.ListVideos.g.cs
index 12ee9ad..5136ca1 100644
--- a/src/libs/Tavus/Generated/Tavus.VideosClient.ListVideos.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.VideosClient.ListVideos.g.cs
@@ -349,17 +349,15 @@ partial void ProcessListVideosResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessListVideosResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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/Tavus/Generated/Tavus.VideosClient.RenameVideo.g.cs b/src/libs/Tavus/Generated/Tavus.VideosClient.RenameVideo.g.cs
index 0a48fc5..fe4b95b 100644
--- a/src/libs/Tavus/Generated/Tavus.VideosClient.RenameVideo.g.cs
+++ b/src/libs/Tavus/Generated/Tavus.VideosClient.RenameVideo.g.cs
@@ -378,17 +378,15 @@ partial void ProcessRenameVideoResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = 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 ProcessRenameVideoResponseContent(
{
}
- throw new global::Tavus.ApiException(
+ throw global::Tavus.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}